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
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
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.
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.
This is work space right??
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
So I will use a LocalScript right but where should I place it Inside the TextLabel or Inside the ScreenGUI ?
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.