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

Issue with "attempt to index nil with 'Locked' "and " attempt to index nil with 'Postion' "?

Asked by 4 years ago

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?

0
Please post the full script in a lua code block. Torren_Mr 334 — 4y
0
You didn't make this script Phobiase 0 — 3y

Answer this question