Advertisement
Guest User

Untitled

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