I have this teleport script that's disabled and the script is part scaled in an area. When it gets enabled, the players in the area gets teleported to a part "BackOut" and the issue I get is an error in the output "moveTo is not a valid Accessory ..."
local Teleport = "BackOut" local Debounce = false function Touch(hit) if not Debounce then Debounce = true local Pos = script.Parent.Parent:findFirstChild(Teleport) hit.Parent:moveTo(Pos.Position) wait(.5) Debounce = false end end script.Parent.Touched:connect(Touch)
Sometimes player's accessories will trigger the Touched
event, you can avoid this error by doing...
if hit.Parent:IsA("BasePart") then -- Check if it is a part and not an accessory hit.Parent:PivotTo(Pos.Position) -- PivotTo is the better version of MoveTo Debouce = false end