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

GUI difficulties help?

Asked by
iLegitus 130
9 years ago

Okay,So ive got myself a screengui inside startergui. (Its a textlabel) Its basically a timer. Whenever a player respawns,The gui changes,If it was 10 seconds left when he/she respawned,It would be 20 the next.

Is there any way i can make it so that it stays the same upon death? For example if it was 5,It stays 5 when it respawns. Basically keeps itself the same?

0
You xImmortalChaos 565 — 9y
0
Is it a timer until re spawn, like for when you die? xImmortalChaos 565 — 9y
0
No,Its like a timer for 120 to 0. iLegitus 130 — 9y
0
Basically it changes text,Like "Hello welcome to the game!" wait(1) "The game will start in " wait(1)....So on so fourth. iLegitus 130 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Alright so here is a perfect system for countdown timers:

Controller Script (The one changing the text)

local alert = game.Lighting.Alert

for i = 120, 0, -1 -- A basic for loop for the countdown
    alert.Value = i
    wait(1)
end

alert.Value = "Begin!"
wait(1)
alert.Value = ""

Put this inside of the TextLabel

local alert = game.Lighting.Alert

update = function()
    script.Parent.Text = alert.Value
end

alert.Changed:connect(update)
update() --So that it will load Alert when you spawn

Alright now put a StringValue inside Lighting called "Alert"

This basically will make it so you can update every single players screen all in unison easily and it will work on death as well

Sidenote: You can name Alert anything you want, it just has to be consistent. I just prefer to use call it Alert

Ad

Answer this question