I am trying to create a missile that explodes after 0.2, 0.3, or 0.4 seconds. I tried doing:
wait(0.2, 0.3, 0.4)
,but it explodes after the amount of seconds that was listed first (0.2).
Is there something else I need to do?
wait() only takes 1 argument; the amount of time in seconds. If you'd like to generate a random number, you can do so with Lua's math library. As math.random fetches a random integer, you'll need to divide by 10, like so.
rand = math.random(2,4) / 10 wait(rand)
Here's a reference for Lua's math library http://lua-users.org/wiki/MathLibraryTutorial