function ToonsToBattle()
local num = math.random(3)
for i,player in pairs(game.Players:GetPlayers())do
local torso=player.Character:FindFirstChild("Torso")
if torso then
if player.TeamColor == BrickColor.new("Bright red") then
if num == 1 then
torso.CFrame=TS1+Vector3.new(0,i*5,0)
elseif num == 2 then
torso.CFrame=TS2+Vector3.new(0,i*5,0)
elseif num == 3 then
torso.CFrame=TS3+Vector3.new(0,i*5,0)
end
end
end
end
end
This script is a function that when called, we take everyone on the Bright red team and move each player to one of three spawns. What I want it to do is select a random spawn for each team member, but instead it selects one for all of them to be teleported to. I thought that making the value of 'num' local would have each player have it happen individually, but that didn't work. Some help with this?

2 comments
what is spawns
Spawns is a list of Vector3s that you want players to spawn at.