I tinkered around with he script but everything still doesn't work
Here's the code
local CD = script.Parent local block = script.Parent.Parent local function OnClicked() local Teleport = "Lentilkac58-Easy-Teleport-2" local 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 --Checks Debounce. 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 script.Parent.Touched:connect(Touch) end CD.MouseClick:Connect(OnClicked)
here's the line it says is wrong:
(It wont work ON CLICK)
script.Parent.Touched:connect(Touch)
Here's the brand new code scripted just for you mate with some explanations.
-- Put the part to which you want to teleport to into the workspace. -- Put this inside the normal script where your teleporter is located at. local PARTNAME = "Teleporter2" -- Put the part name -- Code local buttonPressed = false local ExitPart; pcall(function() ExitPart = workspace:WaitForChild(PARTNAME) -- Searches for the ExitPart in the Workspace where you should have put your teleport to part. end) script.Parent.ClickDetector.MouseClick:Connect(function(player) if not buttonPressed then -- Prevent's a tons of hits at once (thing called debounce) buttonPressed = true local Character = player.Character Character:SetPrimaryPartCFrame(ExitPart.CFrame) Character.PrimaryPart.Position = Vector3.new(Character.PrimaryPart.Position.X, Character.PrimaryPart.Position.Y + 10, Character.PrimaryPart.Position.Z) buttonPressed = false end end)