I'm Making A Game That Needs At Least 2 Players To Start, Is There Anyway To Make A Script To Find How Many Players There Is? I Only Have This So Far:
game.players:GetChildren
I'm Not The Best At Scripting
I'm Making A Game That Needs At Least 2 Players To Start, Is There Anyway To Make A Script To Find How Many Players There Is? I Only Have This So Far:
game.players:GetChildren
I'm Not The Best At Scripting
*To turn "Players" into an integer (Number) value instead of a table/array you put a "#" in-front
so if:*
Players = game.Players:GetChildren() -- This is the total ammount of players
"print(Players)"
Output: "AnAnonymousDeveloper, JamieTheGreatQ777"
Players = game.Players:GetChildren() -- This is the total ammount of players
"print(#Players)"
Output: "2"
So you could have it as:
Players = game.Players:GetChildren() -- This is the total ammount of players
if #Players >= 2 then
GameCanStart = true
end
Hope This Helps! ~ AnAnonymousDeveloper
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
check the wiki on making rounds game
Here's the link: http://wiki.roblox.com/index.php?title=Making_a_Lobby
Thanks!