When I run the game with 3 players 2 people get tp'd and not everyone. Here is the code.
for i, v in ipairs (game.Players:GetPlayers()) do
local chance = math.random(1,4)
print("starting teleport")
if chance == 1 then
v.Character.HumanoidRootPart.CFrame = CFrame.new(Spawn.Position)
elseif chance == 2 then
v.Character.HumanoidRootPart.CFrame = CFrame.new(Spawn1.Position)
elseif chance == 3 then
v.Character.HumanoidRootPart.CFrame = CFrame.new(Spawn2.Position)
elseif chance == 4 then
v.Character.HumanoidRootPart.CFrame = CFrame.new(Spawn3.Position)
end
The spawn and ghost spawn are just variables for the spawns around the map.
It is supposed to teleport the players in game to spawn 1 2 3 or 4 at random and the randomly chosen player (the ghost) gets teleported to the ghost spawn.
If you can solve this please do.

5 comments
You forgot the end of the for...
Are you trying to teleport every player or only the 4 at a time?
every player (also i have the end i just didnt copy and paste it) i am only having it like that for now but i am going to have 12 players so i will have 11 elseif statements
Also ABK im not asking about the math.random im asking why its only teleporting 1 player (other than the ghost) instead of all players
I edited it to make more sense of what im trying to fix