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

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

Asked by
Krlos21 45
10 years ago

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

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

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.

0
So I will use a LocalScript right but where should I place it Inside the TextLabel or Inside the ScreenGUI ? Krlos21 45 — 10y
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. BlackJPI 2658 — 10y
Ad
Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago
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.

0
This is work space right?? HexC3D 830 — 10y

Answer this question