Okay. This is the third time I get a PM telling me to "fix" my script. Therefore I'm going to give you some sound advice:
UPDATE YOUR EMULATOR
Some people are sending me private messages with their consoles filled with bugs. Do you know why is it happening?
Because you haven't updated your emulator since 2012.
Don't believe me? Look at this: https://github.com/rathena/rathena/commit/c3193f3106bb52a0aae956a771ed6a209f0a2a36
This is the commit where rAthena started to allow assigning variables without the use of 'set'. It was a great addition because most programming languages don't need a command to assign variables. Therefore, it's normal that we, scripters, make use of this functionality. This script, and all the scripts I make, don't use the 'set' command because we are in 2017.
HOWEVER...
If you are a naughty person who doesn't want to update his emulator. You can "fix" my script easily by following these simple steps:
Every time you see an equal sign (=) you have to replace it with the set command and a comma.
For example:
variable = 100;
Should be:
set variable, 100;
And with += or -=;
variable +=100;
Should be:
set variable, variable + 100;
And that's all folks.
Sorry for the rant.