Hi, I'm trying to make my game consistantly check if there is more than two players in the game, and if there is, it disables a gui, and enables some scripts, but this doesn't work. I testing it by joining, and then my friend joined, but the gui didn't go away and the scripts didn't enable. Any Help?
Script:
while true do
if #game.Players:GetPlayers() >= 2 then
local SSS = game.ServerScriptService
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
PlayerGui:WaitForChild("TwoPlayers").Enabled = false
PlayerGui:WaitForChild("PartOne").Disabled = false
SSS:WaitForChild("IntBar").Disabled = false
game.Workspace:WaitForChild("Script").Disabled = false
wait()
end
end

2 comments
try making it print how many players. That might help you see where the issue is..
I think you shouldn't repeatedly check. All hail the mighty Changed event.