-------------------------
-- Picks random killer --
-------------------------
players = game.Players:GetChildren()
local randomp = players[math.random(1,#players)]
print(randomp.Name .. " is killer")
randomp.TeamColor = BrickColor.new("Bright red")
for i,v in pairs(players) do
if v.Name ~= randomp.Name then
print(v.Name .. " is runner")
v.TeamColor = BrickColor.new("Bright blue")
end
end
---------------------------------
-- Teleport players to the map --
---------------------------------
rspawn = mapChosenClone.RunnerSpawn:GetChildren()
kspawn = mapChosenClone.KillerSpawn:GetChildren()
for i,v in pairs(game.Players:GetChildren()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if game.Players.TeamColor == "Bright red" then
check:MoveTo(kspawn[i].Position)
elseif game.Players.TeamColor == "Bright blue" then
check:MoveTo(rspawn[i].Position)
end
end
How can I get this to teleport killers to kspawn and runners to rspawn. It works so it picks a killer and the rest are runners. I need it see if a player is on red team, then move them to a spawn or if their on blue move them to a dif spawn. Only on the teleport part is what needs help.

2 comments
can I get it so instead of a location, it mvoes to a thing
that broke the game