Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- function Fly()
- local dummy = Instance.new("Dummy", game.Workspace)
- dummy.Name = "FlyingDummy"
- dummy.CFrame = player.Character.HumanoidRootPart.CFrame
- local attach = Instance.new("Attachment")
- attach.Parent = player.Character.HumanoidRootPart
- attach.Name = "FlyingAttachment"
- attach.Position = Vector3.new(0, 0.5, 0)
- attach.Orientation = Vector3.new(0, 0, 0)
- player.Character.HumanoidRootPart.CFrame = dummy.CFrame
- player.Character.Humanoid:ChangeState(11)
- repeat
- wait()
- dummy.CFrame = CFrame.new(dummy.Position, mouse.Hit.p)
- until not player.Character or not player.Character:FindFirstChild("HumanoidRootPart")
- attach:Destroy()
- dummy:Destroy()
- end
- mouse.KeyDown:connect(function(key)
- if key == "f" then
- Fly()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement