Author Topic: Chances with VCE?  (Read 311 times)

Is there a way to make an event with VCE that will have a X/X% chance of the player adding/subtracting a variable? Like a slot machine, you click a button and it will "roll" numbers 1-100 and if you get 50 you win 500 dollars and if you get 25 you win 50 and so on.


Yes, yes there is.

Code: [Select]
onActivate -> Client -> VCE_modVariable -> Chance -> Set -> 1 (This is the beginning number in X through Y.)
onActivate -> Client -> VCE_modVariable -> Chance -> Rand -> 6 (This is the end number, Y.)
onActivate -> Self -> VCE_ifValue -> <var:cl:Chance> -> Equals -> 6 (3 3)
onVariableTrue -> Client -> CenterPrnt -> You rolled a 6! Congratulations!

You can do two checks to see if it's in a range. >= 5, <= 10 would be any numbers between 5 and 10.