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

1 comment
try local function Touch(hit)