Ah I now get it. You'd need to make a player class (like a health class) to check what the players z value is (inside the
onActionLighthurt()) and control any further stuff from there on.
PHP Code:
function onActionLighthurt() {
if (player.z in |-3, 3|) { //players Z value goes from -3 to 3
//same as if (player.z >= -3 && player.z <= 3)
//Do your stuff inside here
player.chat = "'eyy";
}
}
for the
triggerAction() you'd only need to do
triggeraction(player.x + 1.5 + vecx(player.dir) * 4, player.y + 2 + vecy(player.dir) * 4, "Lighthurt", player.dmg); now