function onTouch(Part) if Part.Parent:findFirstChild("HumanoidRootPart") then while script do wait() local Root = Part.Parent.HumanoidRootPart Root.CFrame = script.Parent.CFrame*CFrame.new(0,script.Parent.Size.Y/2,0)CFrame.Angles(math.rad(-90),0,0) end end end script.Parent.Touched:connect(onTouch)
However, you can use an if statement
to make the code stop running after the function is called. A very simple way would be checking if the part's parent's name is the same as your Character's name, like so,
--Regular Script in par in workspace function onTouch(Part) if script.Parent.Name ~= "wfvj014" then-- makes the code not run if your name is wfvj014. if Part.Parent:findFirstChild("HumanoidRootPart") then while wait() do local Root = Part.Parent.HumanoidRootPart Root.CFrame = script.Parent.CFrame*CFrame.new(0,script.Parent.Size.Y/2,0)CFrame.Angles(math.rad(-90),0,0) end end end end script.Parent.Touched:connect(onTouch)
I also changed the while loop a bit because it was annoying me.
Hope I helped.
Good Luck!