Well if I spelled that numplayers wrong then whatever but anyways how do I use it? Do you have to use a for loop or something? Cause this is what I think you can use but with a numplayer function:
1 | for i = 1 , 4 do |
2 | m = Instance.new( "Hint" , Workspace) |
3 | m.Text = "Waiting for 4 players to join." |
4 | end |
If you know a better way to do this or without a for loop than please help me. THANKS!
game.Players.NumPlayers
--> Returns an integer
For example:
01 | function PlayerEntered(player) |
02 | repeat wait() until player.Character |
03 | if game.Players.NumPlayers = = 1 then -- If the number of players is 1 |
04 | -- only one person here in the server |
05 | elseif game.Players.NumPlayers > = 2 then -- If the number of players is 2 or greater |
06 | -- there is two or more players in the server |
07 | end |
08 | end |
09 |
10 | game.Players.PlayerAdded:connect(PlayerEntered) |
You can also look in the Roblox Wiki.
Web page for NumPlayers: http://wiki.roblox.com/index.php?title=NumPlayers