SphereCommunity
help about if - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: help about if (/Thread-help-about-if)



help about if - Osi - 02-15-2015 05:12 PM

Code:
IF
SRC.DAMAGE <EVAL {5 99}> //I tried when it get damage between 5-99 it must cast spell 55.  I tried many thing but not working any idea? ^^
ref1=<attacker.last>
ref1.spelleffect 55,100.0
say aaa
else
say bbb // if it get damage lower 5 or higher 99 say bbb here true I think
endif



RE: help about if - XuN - 02-15-2015 06:41 PM

There are so much kind of function types: ® Read Only, (W) Write only and (RW) Read and Write.

Damage is W because you can use src.damage n but you cant <src.damage n> because you are telling sphere to do something.
There are no much ® properties or functions right now because we are moving them to RW but armor used to be only read.
STR for example is RW, you can use both str=10 to set it and <str> to retrieve the value.

So the IF is not working beacuse of that, IF src.damage n IS NOT a valid check.

Where are you using this code, is it in the @GetHit trigger? if so you must change that for IF (<argn> >= 5 && <argn><= 99)