Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. function tpa(...)
  2. local valtomove = 25
  3. moving = true
  4. local args = {...}
  5. if #args == 3 then
  6. x = args[1]
  7. y = args[2]
  8. z = args[3]
  9. else
  10. x = args[1].x
  11. y = args[1].y
  12. z = args[1].z
  13. end
  14. if x < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X then
  15. while x < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X do
  16. wait()
  17. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X-valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
  18. end
  19. end
  20. if z < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z then
  21. while z < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z do
  22. wait()
  23. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z-valtomove))
  24. end
  25. end
  26. if x > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X then
  27. while x > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X do
  28. wait()
  29. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X+valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
  30. end
  31. end
  32. if z > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z then
  33. while z > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z do
  34. wait()
  35. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z+valtomove))
  36. end
  37. end
  38. if y < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y then
  39. while y < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y do
  40. wait()
  41. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y-valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
  42. end
  43. end
  44. if y > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y then
  45. while y > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y do
  46. wait()
  47. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y+valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
  48. end
  49. end
  50. moving = false
  51. end
  52.  
  53. spawn(function()
  54. game:getService("RunService"):BindToRenderStep("",0,function()
  55. if not game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid") then return end
  56. if moving == true then
  57. game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid"):ChangeState(11)
  58. end
  59. end)
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement