I want this script to determine how many players are in my game. I want it to update a value, and then I want that value to print so I know the script is working. Output didn't give me anything.
Can someone please help? Here's the script:
local player_count = 0
while wait() do
local Players = {}
for _,v in pairs(game.Players:GetPlayers()) do
table.insert(Players,v)
player_count = player_count + 1
end
end
print(player_count)

3 comments
Yes: local player_count = game.Players.NumPlayer. You cannot change the value of game.Players.NumPlayer though. NumValue is an int value.
How could I get the script to determine how many people are on a certain team?
BTW, it's NumPlayers with an s at the end.