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

I Am Trying To Make A Teleporter Script But I Cant Figure It Out?

Asked by 4 years ago
Edited 4 years ago

Here is the script i am using and its not working (im trying to teleport between parts when touched)

script.Parent.Touched:Connect(function(h)

local hum = h.Parent:FindFirstChild("Humanoid")

if hum ~= nil then

h.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace["Teleporter"].Position

end

end)

I named one of the parts "Teleporter"

0
I've tested your code and it seems to work. Is your script a server script or a local script? xInfinityBear 1777 — 4y
0
Didn't you forgot to close the bracket? Check what the output says, always helpful. imKirda 4491 — 4y

1 answer

Log in to vote
0
Answered by
Auxigin 47
4 years ago
Edited 4 years ago

Try dis

script.Parent.Touched:Connect(function(h)

local hum = h.Parent:FindFirstChild("Humanoid")

if hum ~= nil then

h.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace["Teleporter"].Position)

end

end)

It was because u forgot to close the parenthesis

Ad

Answer this question