Advertisement
princeofheaven

Untitled

Sep 29th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer
  2. repeat wait() until game.Players.LocalPlayer.Character ~= nil
  3. local keystrokes = {"y", "r", "t"}
  4. local playplay = game.Players.LocalPlayer
  5. local char = playplay.Character
  6. local humanoid = char:FindFirstChild("Humanoid")
  7. local Mouse = playplay:GetMouse()
  8. local dontmovedisc = false
  9. local studdistance = 50
  10. local access = false
  11. local thePart = Instance.new("Part", game.Workspace.CurrentCamera)
  12. thePart.Name = "Disc"
  13. thePart.FormFactor = "Custom"
  14. thePart.Size = Vector3.new(0.2, 0.2, 0.2)
  15. thePart.BrickColor = BrickColor.new("Lime green")
  16. thePart.Anchored = true
  17. local mesh = Instance.new("CylinderMesh", thePart)
  18. mesh.Scale = Vector3.new(10, 1, 10)
  19.  
  20. function hotkeys(key)
  21. if key == "w" then
  22. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  23. game.Workspace.CurrentCamera["MoveTo"]:remove()
  24. end
  25. elseif key == "s" then
  26. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  27. game.Workspace.CurrentCamera["MoveTo"]:remove()
  28. end
  29. elseif key == "a" then
  30. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  31. game.Workspace.CurrentCamera["MoveTo"]:remove()
  32. end
  33. elseif key == "d" then
  34. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  35. game.Workspace.CurrentCamera["MoveTo"]:remove()
  36. end
  37. elseif key == string.char(17) then
  38. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  39. game.Workspace.CurrentCamera["MoveTo"]:remove()
  40. end
  41. elseif key == string.char(18) then
  42. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  43. game.Workspace.CurrentCamera["MoveTo"]:remove()
  44. end
  45. elseif key == keystrokes[3] then
  46. if playplay:DistanceFromCharacter(thePart.Position) < studdistance then
  47. dontmovedisc = true
  48. local part = thePart:clone()
  49. part.Parent = game.Workspace.CurrentCamera
  50. part.Name = "MoveTo"
  51. part.Position = thePart.Position
  52. part.Transparency = 0
  53. humanoid:MoveTo(part.Position,part)
  54. else
  55. print("too far!")
  56. end
  57. elseif key == keystrokes[1] then
  58. if game.Workspace.CurrentCamera:FindFirstChild(thePart.Name) then
  59. game.Workspace.CurrentCamera[thePart.Name]:remove()
  60. end
  61. script.Disabled = true
  62. wait()
  63. script.Disabled = false
  64. end
  65. end
  66.  
  67. function move()
  68. dontmovedisc = true
  69. local part = thePart:clone()
  70. part.Parent = game.Workspace.CurrentCamera
  71. part.Name = "MoveTo"
  72. part.Position = thePart.Position
  73. part.Transparency = 1
  74. humanoid:MoveTo(part.Position,part)
  75. end
  76.  
  77. Mouse.Button1Down:connect(function()
  78. if playplay:DistanceFromCharacter(thePart.Position) < studdistance then
  79. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  80. game.Workspace.CurrentCamera["MoveTo"]:remove()
  81. wait()
  82. move()
  83. else
  84. move()
  85. end
  86. else
  87. print("too far!")
  88. end
  89. end)
  90.  
  91. game:GetService("RunService").RenderStepped:connect(function()
  92. if not dontmovedisc then
  93. if playplay:DistanceFromCharacter(thePart.Position) > studdistance then
  94. thePart.Transparency = 1
  95. else
  96. thePart.Transparency = 0
  97. end
  98. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  99. game.Workspace.CurrentCamera["MoveTo"]:remove()
  100. end
  101. --thePart.Position = Mouse.Hit.p
  102. local campos = workspace.CurrentCamera.CoordinateFrame.p
  103. local hit,pos = workspace:findPartOnRay(Ray.new(campos,(Mouse.Hit.p-campos).unit*666),thePart)
  104. if pos then
  105. thePart.CFrame = CFrame.new(pos)
  106. end
  107. else
  108. end
  109. if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  110. game.Workspace.CurrentCamera["MoveTo"].Transparency = 0
  111. if playplay:DistanceFromCharacter(game.Workspace.CurrentCamera["MoveTo"].Position) < 5 then
  112. game.Workspace.CurrentCamera["MoveTo"]:remove()
  113. dontmovedisc = false
  114. end
  115. end
  116. if dontmovedisc then
  117. thePart.Transparency = 1
  118. end
  119. if not game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
  120. dontmovedisc = false
  121. end
  122. end)
  123.  
  124. Mouse.KeyDown:connect(hotkeys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement