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

I need to know how to set this countdown in a screen GUI please?

How do I place this in a screen GUI I am not sure if this actually does the countdown and how do i connect it to a Screen GUI?

local Time = 150

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

2 answers

✓ Accepted answer

To make a countdown Gui, you'll need to insert a ScreenGui then insert a Text Label into that. Now you'll need to change the text of the gui like so:

local Time = 150
local gui = script.Parent

for i = Time, 0, -1 do
	Time = i
	gui.Text = tostring(Time) -- This will change the text to how much time is left
	wait(1)
end

The script will countdown from the desired time (150) in this case, to 0.

2 comments

0

So I will use a LocalScript right but where should I place it Inside the TextLabel or Inside the ScreenGUI ?

0

For this one to work how it is, put it inside the textlabel. By editing the gui variable however, you could place it where ever you would like.

local Time = 150

for i = Time, 0, -1 do
    Time = i -1 -- I believe you just missed the -1
    wait(1)
end

This might fix it. To connect it to a gui, just define the player then work from there.

1 comment

0

This is work space right??

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