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

Want to make it were 5 people can come in basically make value 5

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

2 comments

0

What are you trying to do? You just put down some code, and posted this question without describing what you were trying to do.

0

Can you make more sense and actually discribe what you're doing here please? We can't answer questions like this.

1 answer

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

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