Gold Steal Skill for enemies

I'm trying to make a skill for an enemy that will allow it to steal gold from the player.

What I've tried doing is making a skill that runs a Common Event, which Sets a variable to a random number between 1 and 50 (this is early-game, so I don't want them to steal too much gold), then Decreases Gold by the value set in that variable.

That's it. And the only operation that the skill runs is that Common Event.

Problem is... the game crashes when I try and use it...

So... is this a problem with the battle system (Yami's CTB system) or am I doing something wrong here? I also need some way to make it display a message at the top of the screen like normal skill information that will tell you how much gold was stolen.
Show us the common event and the skill.  Also show us the exact error message you get.

When you use this skill (or any similar that don't actually do damage), what's displayed for damage - does it say it misses, or 0 damage, or something else?

Also, can you provide a link to the battle system you're using, in case it's the problem (I just refuse to go looking for scripts - if someone wants help with a script and they haven't provided a link, I'll just move on to the next person who needs help).
Show us the common event and the skill.  Also show us the exact error message you get.

When you use this skill (or any similar that don't actually do damage), what's displayed for damage - does it say it misses, or 0 damage, or something else?

Also, can you provide a link to the battle system you're using, in case it's the problem (I just refuse to go looking for scripts - if someone wants help with a script and they haven't provided a link, I'll just move on to the next person who needs help).
QfSDF4w.png


A few notes:

- This skill is meant to be a sort of mimic skill for a steal-able skill. The Gold Draw that you steal from the enemy is not the same Gold Draw that the enemy actually uses. The Gold Draw that you get actually works perfectly fine and is based on Yanfly's Steal Items script. However, I needed something for the enemy to use, since it's supposed to be a "Copy Skill", so that's why this skill exists, and it's this one that is causing a problem.

- This skill was tested with an enemy who only knows this skill, the enemy version of Gold Draw. It does not have the player version of Gold Draw at all at this point, or even a normal Attack command. As soon as the enemy's turn comes up, the game crashes with that error.

- I'm using Yami's Charge Turn Battle script, but it's been modified to fix a crashing bug. You can find the modified version in this thread: http://forums.rpgmakerweb.com/index.php?/topic/13223-game-crashing-whenever-berserkconfuseetc-is-used-on-actor-in-yami-ctb/
It's saying @subject.current_action.item is nil.

Try removing the common event from the skill and just add a basic damage formula.  If it still crashes, that lets you know it's the script, not the common event.  If it doesn't crash, add the common event back in and remove the damage.  Then remove the note from the skill - it's POSSIBLE (unlikely, but still worth checking) that the script is reading it as more than just a note.
yeah, it is possible that yami's script (or some other script that you are using) is actually reading the note as a tag for the system...

btw, does the one you made for actors work? and have you tested the skill for some other enemy?
It's saying @subject.current_action.item is nil.

Try removing the common event from the skill and just add a basic damage formula.  If it still crashes, that lets you know it's the script, not the common event.  If it doesn't crash, add the common event back in and remove the damage.  Then remove the note from the skill - it's POSSIBLE (unlikely, but still worth checking) that the script is reading it as more than just a note.
Ahahaha, I'm such a moron. The problem was that the enemy had 0 MP and the skill costs MP and I had not set up my usual condition to use Attack if MP = 0.

Also, I figured out that I can get the second line of the skill Using Message to display variable numbers, so I've also fixed my other problem by making it display "X Gold was stolen!" in that line.

I'm so stupid. Stupid, stupid, stupid!

yeah, it is possible that yami's script (or some other script that you are using) is actually reading the note as a tag for the system...

btw, does the one you made for actors work? and have you tested the skill for some other enemy?
Yeah, the one for actors has always worked. That one isn't done with events, it's done with a script.
Strange that that situation resulted in that message, then.

I'm assuming you mean it's working now, so ...

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/gold-steal-skill-for-enemies.17687/