So I was making a script to choose a random player, but it wasn't working.
while wait(120) do
if game.Players:GetChildren() > 1 then
local randomPlayer = game.Players:GetPlayers()
[math.random(2, #game.Players:GetPlayers())]
print(randomPlayer.Name)
end
end

1 comment
You had the right intentions, but you executed it incorrectly. You want to index a random position in the array determined by ':GetPlayers()': `local RandomPlayer = Players[math.random(1, #Players)]'.