dy = 0 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) dy = dy + timestep*0.01 thisX = fallingguy:getAbsCoorX() thisY = fallingguy:getAbsCoorY() thisZ = fallingguy:getAbsCoorZ() fallingguy:setAbsCoor(thisX, thisY - dy, thisZ) if thisY < 0 then eventFinished = true end end function tick(timestep) RandTime() if randTime > 0 then randTime = randTime - timestep else fallDown(timestep) end return eventFinished end