Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game.Players
- local LocalPlayer = Players.LocalPlayer
- local UIs = game:GetService("UserInputService")
- local Fly = false
- UIs.InputBegan:Connect(function(Key, No)
- if Key.KeyCode == Enum.KeyCode.F and not No then
- Fly = not Fly
- if Fly then
- LocalPlayer.Character.Humanoid:LoadAnimation(Animation):Play()
- else
- LocalPlayer.Character.HumanoidRootPart.Anchored = false
- end
- end
- end)
- spawn(function()
- while wait(0.05) do
- pcall(function()
- if Fly then
- if LocalPlayer.Character.Humanoid.MoveDirection.Magnitude > 0 then
- LocalPlayer.Character:TranslateBy(LocalPlayer.Character.Humanoid.MoveDirection)
- end
- end
- end)
- end
- end)
- spawn(function()
- while wait(0.1) do
- pcall(function()
- if Fly then
- LocalPlayer.Character.HumanoidRootPart.Anchored = not LocalPlayer.Character.HumanoidRootPart.Anchored
- end
- end)
- end
- end)
- while task.wait() do
- pcall(function()
- if Fly then
- LocalPlayer.Character.Humanoid:ChangeState(11)
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement