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

ServerScriptService.Script:29: attempt to get length of global 'Players' (a nil value) ?

Asked by 7 years ago
01local mode = true
02 
03 
04 
05game.Players.PlayerAdded:connect(function(plr)
06    if mode == true then
07        plr.TeamColor = game.Teams["Humans"].TeamColor
08    else
09        plr.TeamColor = game.Teams["Creepers"].TeamColor
10    end
11end)
12 
13 
14while true do
15    wait(1)
View all 37 lines...

script breaking at chosing random players?

1
"#Players". Players isn't defined anywhere. Try replacing that with #Plrs. call23re2 87 — 7y
0
oh thx THEROBLOXAIN2 15 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

You never stated what Players was.

Line 28. You need a table containing a list of players.

Ad

Answer this question