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

How would you make a counting script?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

I know i don't want do

script.Parent.Text = 125
wait(1)
script.Parent.Text = 124

Cause that is the most inefficient way to do so, How would I make a proper count down script? I have the basic outline

function Changed()


end
script.Parent.Parent.ScrollingFrame.Sound.Changed(SoundId)

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

This bit of code will countdown from your desired time amount to zero:

local Time = 150

for i = Time, 0, -1 do
    Time = i
    wait(1)
end

From here you can take the variable Time and make a countdown timer quickly by adding something like this to the script:

gui.Text = tostring(Time)
0
Thanks NotSoNorm 777 — 10y
Ad

Answer this question