Below is the code I used to teleport my players when they step on a block, it used to work wonders! But after some time it stopped working, I looked in the developer console and what I saw is that my clothing is messing the code up? What's supposed to happen is just tp the players but now it does nothing and just spits this error out. I just can't figure out what to do from here.
Some more helpful info: This happens in both Roblox Studio Play Test and just playing with the normal roblox client. I use a normal script not a local script.
local Teleport = "te7"
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)

12 comments
hit.Parent refers to the Accessory itself.
I have a question though, how come this problem didn't happen before? I've had these accessories equiped way before this game was made too.
It could be possible that the part simply didn't pick those parts up and (if they did), they eventually got through your accessories and touched skin.
Ah okay, makes sense.
I put your code in but now I'm getting errors saying it expected something else and not "then".
Never mind, I fixed it by replacing the comma with a dot.
Sorry, your last comment didn't load in. Hit me up again if you get any errors.
Alright, so it works but for some reason now I keep getting teleported and I can't get out of the loop. The previous code I used fixed this and I did the same thing with your code except it isn't working.
When your replaced your code, did you remove the
script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = truepart? You can readd that, if you did.yeah because you told me to replace line 3. But I'll readd it right now.
Yeah, I didn't notice that it was in the line. My fault. Readd it and tell me if your issues are resolved.
Yup all my issues are resolved! Thank you very much!