Have you tried something like this?
Code:if (Math.random() < 0.5) // do this else // do that
|
im trying to make something have a 50% chance of doing something, or doing something else... how would i do this? have never used math.random
Have you tried something like this?
Code:if (Math.random() < 0.5) // do this else // do that
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |