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

My OnClick teleporter wont work?

Asked by 4 years ago
Edited 4 years ago
local CD = script.Parent
    local block = script.Parent.Parent

    local function OnClicked()


    local Teleport = "Lentilkac58-Easy-Teleport-2" 

function Touch(hit)

    if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true 

    local Pos = script.Parent.Parent:findFirstChild(Teleport) 

        hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
script.Parent.Touched:connect(Touch) 


    end

    CD.MouseClick:Connect(OnClicked)

function Touch(hit) Is where it says there's a mistake someone please help

0
try local function Touch(hit) Leamir 3138 — 4y

1 answer

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

The Problem is that there is a missing

end

for the OnClicked() function! Just add it to line 20 and it should work!

Ad

Answer this question