change variable
J_H_Bailey
04 Jan 2019, 05:15Can you change a variable inside and IF Else statement?
I know this is not worded correctly, but I want health to decrease inside an ELSE statement.
Example - {if variable=true:You win!}{else dec health 5:You losing health.}
Any way to do this?
![](https://i.imgur.com/6mfIIbhb.gif)
Bluevoss
04 Jan 2019, 22:20Try this...
{if variable: You win!}
{else: {@health-=5} You are losing health.}
The trick inside if-then logic is to use the following to set variables: {@a=1}. No set required.
J_H_Bailey
05 Jan 2019, 01:03Thanks. That does the trick.
As a follow-up....can I clear the screen with a command inside the else statement? Something like - {else: @clear: Game over.}
![](https://i.imgur.com/6mfIIbhb.gif)
Bluevoss
06 Jan 2019, 04:59That might work. I really don't know. Testing is in order...
J_H_Bailey
06 Jan 2019, 18:23Doesn't work. Somehow I don't think Squiffy is capable to doing it.