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 6 years ago
local status = game.Workspace.Control.Status.StatusColor
local lights = script.Parent.Parent.Status:GetChildren()
local players = game.Players:GetPlayers()

status.Changed:connect(function()
    if status.Value == 0 then
        for i = 1, #lights do
         lights[i].BrickColor = BrickColor.new('Forest green')
        end

        for i = 1, #players do
            players[i].PlayerGui.ThreatLevel.Frame.TextLabel.Text = "Threat Alpha has been triggered"
        end
    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 6 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 — 6y
Ad

Answer this question