Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isnt this teleport script working?

Asked by
TrollD3 105
9 years ago

I want players to spawn on certain parts of a map if they are on certain teams. script:

if plr.TeamColor == game.Teams["Sentinel"].TeamColor then 
target = Vector3.new(48.487, 35.508, 50.1) --Replace those numbers with the desired position!
for i, v in pairs(game.Players:GetChildren()) do 
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
end

if plr.TeamColor == game.Teams["Atlas"].TeamColor then 
    target = Vector3.new(-59.08, 33.905, -111.415) --Replace those numbers with the desired position!
for i, v in pairs(game.Players:GetChildren()) do 
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
end

0
Output? parkderp1 105 — 9y
0
it doesnt say anything TrollD3 105 — 9y
0
You did NOT add all the 'end''s for the Chunks, from the looks of the code. TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
if plr.TeamColor == game.Teams["Sentinel"].TeamColor then 
target = Vector3.new(48.487, 35.508, 50.1) --Replace those numbers with the desired position!
for i, v in pairs(game.Players:GetChildren()) do 
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
end
end

if plr.TeamColor == game.Teams["Atlas"].TeamColor then 
    target = Vector3.new(-59.08, 33.905, -111.415) --Replace those numbers with the desired position!
end
for i, v in pairs(game.Players:GetChildren()) do 
v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
end
end

You forgot to add some ends in your script.

Ad

Answer this question