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

Error with changing GUI text from a script?

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

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

1 comment

0

This should be a comment, not an answer.

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