--> Functions
ChangeTitle = function(newTitle)
for i,v in pairs(game.Players:GetChildren()) do
local toChange = v.PlayerGui:WaitForChild("GameGUI").Title
toChange.Text = newTitle
end
end
--> Main Game Code
if #CurrentPlayers >= 2 then
print("More.")
ChangeTitle("Round starting in 30 seconds!")
elseif #CurrentPlayers < 2 then
print("Less.")
ChangeTitle("Waiting for more players!")
end
Before this, I had an event in Rep where I would call upon from a ServerScript. It was defined in a local-script to take the parameter given upon being called by the ServerScript and to use that to replace the text of the TextLabel.
I'm not understanding what i'm doing wrong here, it seems so simple. But, I have no errors in the console..?
It just won't change the text of the TextLabel.

1 comment
Fixed by adding : repeat wait() until game.Players.NumPlayers>0 before calling upon the function. It was trying to call upon it without a player in the game.