I have a random player chooser script and basically, it will choose a random player and give him clothes and place him on a team. It worked fine in Studio but now it's gone to shreds, nothing is working. Here is the script:
wait(0.1)
local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
randomPlayer.TeamColor = BrickColor.new("Really black")
Any ideas on how I an fix this?

2 comments
I don't see a problem. How did the script work in Studio?
It waited less than a second and put me on the team I specified since I didn't have anyone else. I tried it on the actual game and nothing happens, nothing appears in the console or anything. I tried remaking it and it worked fine in Studio, but yet again failed to work on the actual game.