Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer
- repeat wait() until game.Players.LocalPlayer.Character ~= nil
- local keystrokes = {"y", "r", "t"}
- local playplay = game.Players.LocalPlayer
- local char = playplay.Character
- local humanoid = char:FindFirstChild("Humanoid")
- local Mouse = playplay:GetMouse()
- local dontmovedisc = false
- local studdistance = 50
- local access = false
- local thePart = Instance.new("Part", game.Workspace.CurrentCamera)
- thePart.Name = "Disc"
- thePart.FormFactor = "Custom"
- thePart.Size = Vector3.new(0.2, 0.2, 0.2)
- thePart.BrickColor = BrickColor.new("Lime green")
- thePart.Anchored = true
- local mesh = Instance.new("CylinderMesh", thePart)
- mesh.Scale = Vector3.new(10, 1, 10)
- function hotkeys(key)
- if key == "w" then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == "s" then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == "a" then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == "d" then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == string.char(17) then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == string.char(18) then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- elseif key == keystrokes[3] then
- if playplay:DistanceFromCharacter(thePart.Position) < studdistance then
- dontmovedisc = true
- local part = thePart:clone()
- part.Parent = game.Workspace.CurrentCamera
- part.Name = "MoveTo"
- part.Position = thePart.Position
- part.Transparency = 0
- humanoid:MoveTo(part.Position,part)
- else
- print("too far!")
- end
- elseif key == keystrokes[1] then
- if game.Workspace.CurrentCamera:FindFirstChild(thePart.Name) then
- game.Workspace.CurrentCamera[thePart.Name]:remove()
- end
- script.Disabled = true
- wait()
- script.Disabled = false
- end
- end
- function move()
- dontmovedisc = true
- local part = thePart:clone()
- part.Parent = game.Workspace.CurrentCamera
- part.Name = "MoveTo"
- part.Position = thePart.Position
- part.Transparency = 1
- humanoid:MoveTo(part.Position,part)
- end
- Mouse.Button1Down:connect(function()
- if playplay:DistanceFromCharacter(thePart.Position) < studdistance then
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- wait()
- move()
- else
- move()
- end
- else
- print("too far!")
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- if not dontmovedisc then
- if playplay:DistanceFromCharacter(thePart.Position) > studdistance then
- thePart.Transparency = 1
- else
- thePart.Transparency = 0
- end
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- end
- --thePart.Position = Mouse.Hit.p
- local campos = workspace.CurrentCamera.CoordinateFrame.p
- local hit,pos = workspace:findPartOnRay(Ray.new(campos,(Mouse.Hit.p-campos).unit*666),thePart)
- if pos then
- thePart.CFrame = CFrame.new(pos)
- end
- else
- end
- if game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- game.Workspace.CurrentCamera["MoveTo"].Transparency = 0
- if playplay:DistanceFromCharacter(game.Workspace.CurrentCamera["MoveTo"].Position) < 5 then
- game.Workspace.CurrentCamera["MoveTo"]:remove()
- dontmovedisc = false
- end
- end
- if dontmovedisc then
- thePart.Transparency = 1
- end
- if not game.Workspace.CurrentCamera:FindFirstChild("MoveTo") then
- dontmovedisc = false
- end
- end)
- Mouse.KeyDown:connect(hotkeys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement