Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- create a function to toggle fly mode
- local function toggleFly()
- -- get the player's character and humanoid
- local character = game.Players.LocalPlayer.Character
- local humanoid = character:WaitForChild("Humanoid")
- -- toggle the humanoid's fly ability
- humanoid.WalkSpeed = 100
- humanoid.CanFly = not humanoid.CanFly
- end
- -- bind the toggleFly function to the "f" key
- game.ContextActionService:BindAction("fly", toggleFly, true, "f")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement