PLAYERS=workspace.PLAYERS player=script.Parent.Parent gui=script.Parent wait(1) if player:findFirstChild("inhere") then wait() else local d=Instance.new("ObjectValue") d.Parent=player d.Name="inhere" local s=Instance.new("NumberValue") s.Parent=player s.Name="playernumber" gui.AllPoints:clone().Parent=player gui.Points:clone().Parent=player gui.ShotsA:clone().Parent=player gui.ShotsM:clone().Parent=player wait() if player.TeamColor==BrickColor.new("Bright red") then gui.Red:clone().Parent=player.Character.Torso if PLAYERS.RED.one.Value~="" then if PLAYERS.RED.two.Value~="" then if PLAYERS.RED.three.Value~="" then if PLAYERS.RED.four.Value~="" then wait(1) player:Destroy() local m=Instance.new("Message") m.Parent=workspace m.Text="Not Enough Space." wait(2.5) workspace.Message:Remove() else PLAYERS.RED.four.Value=player.Name player.playernumber.Value=4 end else PLAYERS.RED.three.Value=player.Name player.playernumber.Value=3 end else PLAYERS.RED.two.Value=player.Name player.playernumber.Value=2 end else PLAYERS.RED.one.Value=player.Name player.playernumber.Value=1 end elseif player.TeamColor==BrickColor.new("Bright blue") then gui.Blue:Clone().Parent=player.Character.Torso if PLAYERS.BLUE.one.Value~="" then if PLAYERS.BLUE.two.Value~="" then if PLAYERS.BLUE.three.Value~="" then if PLAYERS.BLUE.four.Value~="" then wait(1) player:Destroy() local m=Instance.new("Message") m.Parent=workspace m.Text="Not Enough Space." wait(2.5) workspace.Message:Remove() else PLAYERS.BLUE.four.Value=player.Name player.playernumber.Value=4 end else PLAYERS.BLUE.three.Value=player.Name player.playernumber.Value=3 end else PLAYERS.BLUE.two.Value=player.Name player.playernumber.Value=2 end else PLAYERS.BLUE.one.Value=player.Name player.playernumber.Value=1 end else wait(1) player:Destroy() local m=Instance.new("Message") m.Parent=workspace m.Text="Error..." wait(2.5) workspace.Message:Remove() end end
Well, nobody seems to really understand you. I read your question quite a few times, and what you're looking for is NumPlayers
. It's a property of Players so...
if (game.Players.NumPlayers == 1) then game.Workspace.PlayerAmount.Value = 1 end
Marked as Duplicate by User#2
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?