randTime = 0 eventFinished = false randinit = false function RandTime() if not randinit then math.randomseed(os.clock()) randinit = true randTime = 10 * math.random() end end function fallDown(timestep) eventFinished = true end function tick(timestep) RandTime() if randTime > 0 then randTime = randTime - timestep else io.write("Falldown called \n") fallDown(timestep) end return eventFinished end