So I'm making a project called Lights On, where basically you have to hide in the darkness for 60 seconds and after 60 seconds the lights turn on and a monster is after you and then you have 3 more minutes to survive, once you survive you get 10 points.
So after 60 seconds, the lights turn on, how do I do that? I'd really appreciate your help :)! (idk how to script)
Let's try this approach.
t = math.floor(tick()) seconds = 10 while math.floor(tick()) ~= t + seconds do wait(.5) --So it doesn't lag so much end print("The time has come.")
tick()
is a function that returns how many seconds have passed since January 1, 1970. That's not important to know. What's important is that we can use this to get differences in time.
t1 = tick() wait(10) t2 = tick() print("Around "..math.floor(t2 - t1).." seconds have passed.")
That's 10 seconds that have passed. The while loop keeps waiting until the time passed since "t" is 10.