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

Error with changing GUI text from a script?

Asked by 7 years ago
01local status = game.Workspace.Control.Status.StatusColor
02local lights = script.Parent.Parent.Status:GetChildren()
03local players = game.Players:GetPlayers()
04 
05status.Changed:connect(function()
06    if status.Value == 0 then
07        for i = 1, #lights do
08         lights[i].BrickColor = BrickColor.new('Forest green')
09        end
10 
11        for i = 1, #players do
12            players[i].PlayerGui.ThreatLevel.Frame.TextLabel.Text = "Threat Alpha has been triggered"
13        end
14    end

no errors in workspace what it's trying to do is get all the players from game.Players and then change the GUI once .status is == 0 I checked in workspace when in server test and the .status value did = 0 the top part is working it's just the part where it's changing the GUI text isn't

1 answer

Log in to vote
0
Answered by 7 years ago

I didn't think, the getplayers was loading before any players were added it's working now

0
This should be a comment, not an answer. thesit123 509 — 7y
Ad

Answer this question