#simple timer thing

10 messages · Page 1 of 1 (latest)

west parrot
#

I want to make a timer in my game, I can do that but i want one that works like this:
00:00:00
the one i have only shows the number, how can i make it look and work like how I want it to

lean depot
#

can you send what you have right now

west parrot
#

sure

west parrot
lean depot
#

local timer = 3605 -- Example timer value in seconds (1 hour, 5 seconds)

-- Function to format the timer
local function formatTimer(seconds)
local hours = math.floor(seconds / 3600)
local minutes = math.floor((seconds % 3600) / 60)
local secs = seconds % 60
return string.format("%02d:%02d:%02d", hours, minutes, secs)
end

-- Updating the timer
while timer >= 0 do
print("Timer: " .. formatTimer(timer)) -- Display the formatted timer
wait(1) -- Wait for 1 second
timer -= 1 -- Decrement the timer by 1 second
end

#

im kinda rusty idk

west parrot
#

@lean depot what is "timer" in the script exactly?

#

the text displayed?