@Jay:
I think you're looking at this (see link below), where I took out the related lines, as I thought LOWT didn't want the 'if (orc.dead) { msg ("The orc is already dead, silly") }', (as seen in his~her responding post:
viewtopic.php?f=10&t=5340&start=15#p37022 : "... when I try to fight it again after killing it it repeats after saying 'The orc is already dead'. How do I stop it from repeating? (LOWT)", which I responded to, as seen below) :
viewtopic.php?f=10&p=37037#p37024add new script -> variables -> 'set a variable or attribute' Script -> set variable orc.current_life = [expression] orc.current_life - player.damage
add new script -> output -> 'print a message' Script -> print [expression] "You attack the orc, doing {player.damage} damage, leaving the orc with {orc.current_life} life left."
add new script -> scripts -> 'if' Script -> if [expression] orc.current_life <= 0
-> then -> add new script -> output -> 'print a message' Script -> print [message] You killed the orc!
add else -> add new script -> variables -> 'set a variable or attribute' Script -> set variable player.current_life = [expression] player.current_life - orc.damage
-> add new script -> output -> 'print a message' Script -> print [expression] "The orc attacks you, doing {orc.damage} damage, leaving you with {player.current_life} life left."
-> add new script -> scripts -> 'if' Script -> if [expression] player.current_life <= 0
->-> then -> add new script -> output -> 'print a message' Script -> print [message] The orc killed you.
->-> add new script -> output -> 'print a message' Script -> print [message] GAME OVER
->-> add new script -> game state -> 'finish the game' Script
---
whereas, in my original~prior~previous code (see below), I have the needed lines:
viewtopic.php?f=10&t=5340#p36976add new script -> scripts -> 'if' Script -> if [expression] orc.dead-> then -> add new script -> output -> 'print a message' Script -> print [message] The orc is already dead, silly.
add
else -> add new script -> variables -> 'set a variable or attribute' Script -> set variable orc.current_life = [expression] orc.current_life - player.damage
-> add new script -> output -> 'print a message' Script -> print [expression] "You attack the orc, doing {player.damage} damage, leaving the orc with {orc.current_life} life left."
-> add new script -> scripts -> 'if' Script -> if [expression] orc.current_life <= 0
->-> then -> add new script -> variables -> 'set a variable or attribute' Script -> set variable orc.dead = [expression] true->-> add new script -> output -> 'print a message' Script -> print [message] You killed the orc!
-> add else -> add new script -> variables -> 'set a variable or attribute' Script -> set variable player.current_life = [expression] player.current_life - orc.damage
->-> add new script -> output -> 'print a message' Script -> print [expression] "The orc attacks you, doing {orc.damage} damage, leaving you with {player.current_life} life left."
->-> add new script -> scripts -> 'if' Script -> if [expression] player.current_life <= 0
->->-> then -> add new script -> output -> 'print a message' Script -> print [message] The orc killed you.
->->-> add new script -> output -> 'print a message' Script -> print [message] GAME OVER
->->-> add new script -> game state -> 'finish the game' Script
------------------------
@LOWT:
LOWT wrote:I would like if that message only showed once, after you first kill it.
then, don't keep clicking on the 'fight' hyperlink~button...
The 'You already killed the orc, silly" message is a way of informing the person playing of the blocking the 'fight' scripting from activating (as the orc is dead). I guess if you really want to, I suppose you could do~use the 'firsttime~otherwise' Script, so that you only get that message the first time you click on 'fight' of the dead orc, or your other option is to just not have any message at all (but that will confuse the person playing the game, as they click on 'fight' of the dead orc, but nothing happens... you need to tell them why, as it may not be intuitive for them... orc is dead... you can't fight it anymore, lol).