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

I need help on this teleport script?

Asked by
exit16 20
10 years ago
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)
0
It looks like you're missing an end parenthesis after Vector3.new(0,3,0) jakedies 315 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago
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.

0
No, that's not the problem. CFrame.new(v3) is a valid constructor. jakedies 315 — 10y
0
Aurum I believe that the script you just gave me doesn't work it just errors out and crashes studio lol. exit16 20 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago
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.

Answer this question