Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make an Advanced Timer System?

Asked by 4 years ago

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

0
This is easy. All you need is a format-string. Unfortunately, I cannot give you the required pattern here as the JavaScript in this website will interpret it so. Send me a FR on Discord, I'll help you from there. Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question