Code:
Now, when I remove "&& (target.isStateAffected(30), I still get the same error, but when I revert it back to the original script which asked if the target's Class is ID 3, the script runs as intended again. What is it I'm doing wrong?<Post-Damage Eval>
if (target.isActor() && (target.isStateAffected(30)) {
if (!target.isLearnedSkill(item.id)) {
if (Math.randomInt(100) < target.luk * 5) {
target.learnSkill(item.id);
var text = target.name() + ' has learned '
text = text + item.name + '!';
$gameMessage.add(text);
}
}
}
</Post-Damage Eval>The picture I added is of the error message.