Advertisement
skinkillaz

deadmist

Sep 13th, 2018
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. plr = game.Players.LocalPlayer
  2. char = plr.Character
  3. root = char.HumanoidRootPart
  4. root2 = char.Head
  5. wait()
  6. local pos = game.Workspace.js2199.Head.Position
  7.  
  8. local time = 0.1
  9. local increment = 3
  10. local debounce = false
  11. local diff = pos-root.Position
  12. local mag = diff.magnitude
  13. local heading = CFrame.new(root.Position, pos).lookVector
  14. local function movetocustlocation()
  15. if debounce then return end
  16. debounce = true
  17. for a = 0, mag, increment do
  18. if cancelmove then
  19. print("Stopped moving to location")
  20. break
  21. end
  22. root2.CanCollide = false
  23. root.Anchored = false
  24. root.CFrame = root.CFrame + (heading * increment)
  25. wait( (time/mag) * increment )
  26. end
  27. root2.CanCollide = true
  28. debounce = false
  29. root.Anchored = false
  30. end
  31. movetocustlocation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement