Advertisement
goku13l

fly script

Jan 2nd, 2023
1,179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | Source Code | 0 0
  1. -- create a function to toggle fly mode
  2. local function toggleFly()
  3.   -- get the player's character and humanoid
  4.   local character = game.Players.LocalPlayer.Character
  5.   local humanoid = character:WaitForChild("Humanoid")
  6.  
  7.   -- toggle the humanoid's fly ability
  8.   humanoid.WalkSpeed = 100
  9.   humanoid.CanFly = not humanoid.CanFly
  10. end
  11.  
  12. -- bind the toggleFly function to the "f" key
  13. game.ContextActionService:BindAction("fly", toggleFly, true, "f")
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement