Random Number Subtraction Syntax (Solved)

Hey all :)

So I know how to generate a random number.

player.health = GetRandomInt (3,15)
msg ("<br/><font color="dedede">You've recovered "+ player.health +"!</font color>")

but is there a way to use a similar code to subtract health? Like for example...

player.health = GetRandomInt (-3,-15) 

OR maybe

player.health = player.health - GetRandomInt (3,15)
msg ("<br/><font color="dedede">You've lost "+ player.health +"!</font color>")

I appreciate any help ^_^

Anonynn.


you got it yourself with this code line of yours:

player.health = player.health - GetRandomInt (3,15)


Thanks HK! :D

Anonynn.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums