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

GUI difficulties help?

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?

4 comments

0

You

0

Is it a timer until re spawn, like for when you die?

0

No,Its like a timer for 120 to 0.

0

Basically it changes text,Like "Hello welcome to the game!" wait(1) "The game will start in " wait(1)....So on so fourth.

1 answer

✓ Accepted answer

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

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