#How to make a respawn timer match a TextLabel timer

5 messages · Page 1 of 1 (latest)

reef pine
#

You can use os.time()

#

It´s basically a function that shows how many seconds have passed since 1st January 1970

#

So instead of using a wait() you can save a variable with the current os.time() and then when you want to check if the 20 minutes have passed just create another variable with the os.time() and subtract it from the os.time() you created when the timer started

#
local WhenTimerStarted = os.time() --Seconds passed since 1/1/1970 at the moment this variable was created

Chest.Touched:Connect(function(hit) 

local TimePassed = os.time() --Seconds passed since 1/1/1970 at the moment the chest got touched (obviously more than When the timer started)

local Timer = (TimePassed - WhenTimerStarted) -- Time passed since the timer started

if Timer >= 20MinutesInSeconds Then

end
end)