Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

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

Asked by 10 years ago

This question already has an answer here:

How do I use numplayers?
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
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. Thewsomeguy 448 — 10y
0
Can you make more sense and actually discribe what you're doing here please? We can't answer questions like this. coo1o 227 — 10y

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?

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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
Ad