So I want to know how we can make an advanced timer which we use for Minigames and other things like a Battle Royale I already know about the for i = 0,10,1 do but i want to have it more advanced timer which could do more than the normal for i = 0,10,1 do for example it should have: 3:20 instead of 20 seconds
You can use my idea if you wish
In replicated Storage add 3 number values. And in this example, it'll be placed in a folder called "TimerTag".
Object1) Minutes Object2) Seconds Object3) TimerValue
in the script I'll do
while true do wait() if game.ReplicatedStorage.TimerTag.TimerValue.Value == 1 then if game.ReplicatedStorage.Seconds.Value <= 0 then if game.ReplicatedStorage.Minutes.Value <= 0 then wait() -- not enough timer left. else game.ReplicatedStorage.Minutes.Value = game.ReplicatedStorage-1 game.ReplicatedStorage.Seconds.Value = 60 end else game.ReplicatedStorage.Seconds.Value = game.ReplicatedStorage.Seconds.Value - 1 end end end
end
and on the timer label or text label whatever do this -- localscript placed inside the text
local min = 0 local sec = 0
while wait() do if game.ReplicatedStorage.Minutes.Value <= 9 then min = "0"..game.ReplicatedStorage.Minutes.Value else min = game.ReplicatedStorage.Minutes.Value end if game.ReplicatedStorage.Minutes.Value <= 9 then sec = "0"..game.ReplicatedStorage.Seconds.Value else sec = game.ReplicatedStorage.Seconds.Value end script.Parent.Text = min..":"..sec end