Script Support for Teleport - Output

I get this message in my output. If I touch a teleporter pad. It depends on luck sometimes it works and it teleports me. But other times it don’t. I want to know how to fix this issue and what is the “gaga glasses”

SCREENSHOT


The Script I used is basic.

function Touch(hit) --Indicates that the Part has been Touched.
   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) --Gets the Part to teleport to.
   	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) --Listens out for Touchers.  ```
2 Likes

MoveTo only works for models. The part that is being detected is a part inside an accessory. A simple solution is to check if the parent of the part that touched the teleporter has a humanoid inside.

1 Like

Thank you for your reply, but how do I check if the parent of the part has a humanoid? When I select/tap on the output error it takes me to:

 hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end
2 Likes

What you can do is in the first if statement in the Touch function, you can add
and hit.Parent:FindFirstChild("Humanoid") then
If there is no humanoid, FindFirstChild will return nil and it will not proceed.

1 Like