local Tel1 = script.Parent
local Tel2 = script.Parent.Parent.Tel2
function onTouch(Brick)
local Player = Brick.Parent:FindFirstChild("Humanoid")
if(Player ~=nil) then
Player.Parent.Torso.CFrame = CFrame.new(Tel2.Position+Vector3.new(0,3,0)
end
end
Tel1.Touched:connect(onTouch)
COMMUNITY QUESTION
I need help on this teleport script?
2 answers
local Tel1 = script.Parent
local Tel2 = script.Parent.Parent.Tel2
function onTouch(Brick)
local Player = Brick.Parent:FindFirstChild("Humanoid")
if(Player ~=nil) then
Player.Parent.Torso.CFrame = CFrame.new(Tel2.CFrame+Vector3.new(0,3,0)
end
end
Tel1.Touched:connect(onTouch)
Your problem lies in line 6. CFrame.new() expects a CFrame value, but instead you have provided a Vector3. I have fixed it for you.
I'm Aurum, and you're welcome.
2 comments
0
No, that's not the problem. CFrame.new(v3) is a valid constructor.
0
Aurum I believe that the script you just gave me doesn't work it just errors out and crashes studio lol.
local Tel1 = script.Parent
local Tel2 = script.Parent.Parent.Tel2
function onTouch(Brick)
local Player = Brick.Parent:FindFirstChild("Humanoid")
if(Player ~=nil) then
Player.Parent.Torso.CFrame = CFrame.new(Tel2.CFrame+Vector3.new(0,3,0))
end
end
Tel1.Touched:connect(onTouch)
He forgot end parenthesis too. This one should work now.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
It looks like you're missing an end parenthesis after Vector3.new(0,3,0)