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

How do I fix this script?

Asked by 8 years ago

I am trying to teleport a player when they touch a part, but it isn't bringing any output, therefore, not letting me debug. Code :

local plyr = game.Players.LocalPlayer

function onTouched()
    script.Parent.Touched:connect(plyr).Torso.Position = Vector3.new(5.194, 3.37, 45.765)
end

2 answers

Log in to vote
3
Answered by 8 years ago

This is what you left out:

local plyr = game.Players.LocalPlayer

function onTouched()
    script.Parent.Touched:connect(plyr).Torso.Position = Vector3.new(5.194, 3.37, 45.765)
end

script.Parent.Touched:connect(onTouched)
Ad
Log in to vote
2
Answered by 8 years ago
local plyr = game.Players.LocalPlayer



function onTouched()

    script.Parent.Touched:connect(plyr).Torso.Position = Vector3.new(5.194, 3.37, 45.765)

end



script.Parent.Touched:connect(onTouched)

Answer this question