Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a timer once activated ?

I'm sorry guys but i can't find this anywhere in the wiki i don't know how to do it

i just want to make a timer that shows time in a gui once the tool's activated

example u draw ur sword a timer of 1:00 shows on ur screen and goes from 1:00 to 0 like 0:59, 0:58, 0:57 etc... and when it reaches 0, do something

How can u do it ?

script.Parent.Activated:connect(function)
	--what now ;-;
end)

1 answer

✓ Accepted answer

Although this is a forum where you are asking for help, not for us to do everything for you, I still did everything for you.

script.Parent.Activated:connect(function) --When the tool (script.Parent) is activated, it will do the following
	for i=60,1,-1 do --a loop that is used for a specific amount of times.
		game.Players.LocalPlayer.PlayerGui.Timer.Frame.TextBox.Text = "Time left: "..i
		wait(1)
		if i == 0 then --checks if the loop is == 0
			--code here for what you want to do
		end
		if i == 60 then --checks if the loop is == 60
			game.Players.LocalPlayer.PlayerGui.Timer.Frame.TextBox.Text == ""Time left: 1:00"
		end
	end
end)

5 comments

0

YESSS , thank you bless you sir :)

0

But, does this tick from 1:00 to 0:59 or ? no

0

Like if theres 5:00 minutes then it should go with the column like 4:59 3:59 everytime it hits zeros change it does it work like that or no ?

0

the if i == 0 then doesn't work

0

Ill fix it, give me one second okay? and also the minute thing you have to do yourself, for example if .Frame.TextBox.Text == "60" then frame.TextBox.Text = "1:00" end

This discussion is preserved as it was. New answers, comments, and votes are closed.