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
10 years ago

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

01if plr.TeamColor == game.Teams["Sentinel"].TeamColor then
02target = Vector3.new(48.487, 35.508, 50.1) --Replace those numbers with the desired position!
03for i, v in pairs(game.Players:GetChildren()) do
04v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
05end
06 
07if plr.TeamColor == game.Teams["Atlas"].TeamColor then
08    target = Vector3.new(-59.08, 33.905, -111.415) --Replace those numbers with the desired position!
09for i, v in pairs(game.Players:GetChildren()) do
10v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
11end
0
Output? parkderp1 105 — 10y
0
it doesnt say anything TrollD3 105 — 10y
0
You did NOT add all the 'end''s for the Chunks, from the looks of the code. TheeDeathCaster 2368 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
01if plr.TeamColor == game.Teams["Sentinel"].TeamColor then
02target = Vector3.new(48.487, 35.508, 50.1) --Replace those numbers with the desired position!
03for i, v in pairs(game.Players:GetChildren()) do
04v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
05end
06end
07 
08if plr.TeamColor == game.Teams["Atlas"].TeamColor then
09    target = Vector3.new(-59.08, 33.905, -111.415) --Replace those numbers with the desired position!
10end
11for i, v in pairs(game.Players:GetChildren()) do
12v.Character.Torso.CFrame = CFrame.new(target + Vector3.new(0, i * 5, 0)) -- Adds an offset of 5 to each player teleported.
13end
14end

You forgot to add some ends in your script.

Ad

Answer this question