I need to pick a random player from the server and make them a hunter, but when I trigger this line of code I get an error like:
ServerScriptService.RoundSystem:106: invalid argument #2 to 'random' (interval is empty)
Here is the code:
local function teleportalltomap()
wait_for_characters(players:GetPlayers()) -- call our function, passing all the players in the game
print("All players' characters have loaded.")
wait(2)
local players = game.Players:GetChildren()
local chosenhunter = players[math.random(1,#players)]
print(chosenhunter)
chosenhunter.Team = game.Teams.Hunters
local propgun = game.ReplicatedStorage.PropGun:Clone()
propgun.Parent = chosenhunter.Backpack
huntercount.Value += 1
chosenhunter.Character.HumanoidRootPart.CFrame = CFrame.new(maploc)
if someone can help me get rid of this error that would be awesome. Thanks!

3 comments
The error is at line 106, u r showing the script up to line 12.......
Which line is line 106 here?
Looks like the error is at line 6