Advertisement
Guest User

Chance

a guest
Oct 21st, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// @description Chance(chance)
  2. /// @function Chance
  3. /// @param chance
  4.  
  5. // Return a [value] if it's over another random value
  6.  
  7. return argument0 > random(1); // Example: Chance(0.7); -> Compare 0.7 to random(1) result[0.0 to 1.0]. If random result is any number between 0.1 and 0.7(70%)
  8.                                                         // the function will exec some code. Else, if it is between 0.8 and 1.0(30%), it will do nothing.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement