I tried to make a teleport portal, but when I done scripting, it said "attempt to index nil with 'Locked' " , then I try to remove the Locked script ( locked to cooldown ) but then it said " attempt to index nil with 'Postion' " , any help?
The script error happend at line 3 : local Teleport = "Tele2" 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 script.Parent.Touched:connect(Touch)
Removed cooldown script :
local Teleport = "Tele2" function Touch(hit) local Pos = script.Parent.Parent:findFirstChild(Teleport) hit.Parent:moveTo(Pos.Position) end end script.Parent.Touched:connect(Touch)
Any help please?