By this time, I've done everything that I could think of. For a game that I'm developing, I'm making a timer script for the Intermission. I remembered that somebody could join in-between, and they wouldn't see the GUI, so I tried to make it happen. In the GUI, it has a while loop that makes the text the value of the IntValue. This works perfectly fine in 'Play Solo', just not in a server. Any tips?
while true do wait() if game.Workspace.Timers.Value == true then -- I have a script that does this and it works fine. game.Workspace.Timers.Value = false for i=1,30 do game.Workspace.Time.Value = game.Workspace.Time.Value - 1 wait(1) end for i,v in pairs(game.Players:GetChildren()) do v.PlayerGui.Intermission:Destroy() end game.StarterGui.Intermission:Destroy() end wait() end
I tested it and changed :GetChildren()
to :GetPlayers()
which may be the case. As well as changing the variable you put for players to _ in-case it was a variable problem. Nothing else seemed to be broken after that.
while true do wait() if game.Workspace.Timers.Value == true then game.Workspace.Timers.Value = false for i=1,30 do game.Workspace.Time.Value = game.Workspace.Time.Value - 1 wait(1) end for _,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.Intermission:Destroy() end game.StarterGui.Intermission:Destroy() end wait() end