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

How to check if there is more than 1 player ingame? [SOLVED]

I fixed it myself. Here is the fixed script:

game.Players.PlayerAdded:connect(function(plr)
if game.Players.NumPlayers >= 2 then
	msg =Instance.new("Hint", game.Workspace)
	msg.Text = "Game Start!"
else
	msg = Instance.new("Hint", game.Workspace)
	msg.Text = "2 players needed to start."
end
end)

1 answer

✓ Accepted answer

>= Means greater than or equal to. If the number of players is greater than or equal to one (which it is), then it will still return true. Replace 1 with 2 on line 2 and it should work.

game.Players.PlayerAdded:connect(function(plr)
if game.Players.NumPlayers >= 2 then
    msg =Instance.new("Hint", game.Workspace)
    msg.Text = "Game Start!"
else
    msg = Instance.new("Hint", game.Workspace)
    msg.Text = "2 players needed to start."
end
end)

Please accept this answer if I helped! :D

2 comments

0

I fixed it before I saw your answer. But ill still give you the point because its true!

0

Heh, I was typing my answer as you updated your's. Sorry.

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