Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plr = game.Players.LocalPlayer
- char = plr.Character
- root = char.HumanoidRootPart
- root2 = char.Head
- wait()
- local pos = game.Workspace.js2199.Head.Position
- local time = 0.1
- local increment = 3
- local debounce = false
- local diff = pos-root.Position
- local mag = diff.magnitude
- local heading = CFrame.new(root.Position, pos).lookVector
- local function movetocustlocation()
- if debounce then return end
- debounce = true
- for a = 0, mag, increment do
- if cancelmove then
- print("Stopped moving to location")
- break
- end
- root2.CanCollide = false
- root.Anchored = false
- root.CFrame = root.CFrame + (heading * increment)
- wait( (time/mag) * increment )
- end
- root2.CanCollide = true
- debounce = false
- root.Anchored = false
- end
- movetocustlocation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement