Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My OnClick teleporter wont work?

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

0

try local function Touch(hit)

1 answer

The Problem is that there is a missing

end

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

This discussion is preserved as it was. New answers, comments, and votes are closed.