Actuallyimabaddie

Fly

Oct 17th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. -- Mobile-only Fly Button Script (LocalScript inside ScreenGui)
  2. local Players = game:GetService("Players")
  3. local UserInputService = game:GetService("UserInputService")
  4. local RunService = game:GetService("RunService")
  5.  
  6. -- Make sure we only run this on mobile
  7. if not UserInputService.TouchEnabled then
  8. script.Disabled = true
  9. return
  10. end
  11.  
  12. local player = Players.LocalPlayer
  13. local char = player.Character or player.CharacterAdded:Wait()
  14. local hrp = char:WaitForChild("HumanoidRootPart")
  15. local humanoid = char:WaitForChild("Humanoid")
  16.  
  17. local flyButton = script.Parent:WaitForChild("FlyButton")
  18.  
  19. local flying = false
  20. local bv
  21.  
  22. local function startFly()
  23. if flying then return end
  24. flying = true
  25. flyButton.Text = "STOP FLY"
  26. bv = Instance.new("BodyVelocity")
  27. bv.Velocity = Vector3.new(0, 0, 0)
  28. bv.MaxForce = Vector3.new(0, 0, 0)
  29. bv.Parent = hrp
  30. end
  31.  
  32. local function stopFly()
  33. flying = false
  34. flyButton.Text = "FLY"
  35. if bv then
  36. bv:Destroy()
  37. bv = nil
  38. end
  39. end
  40.  
  41. flyButton.MouseButton1Down:Connect(function()
  42. if not flying then
  43. startFly()
  44. else
  45. stopFly()
  46. end
  47. end)
  48.  
  49. -- Update velocity while flying
  50. RunService.Heartbeat:Connect(function()
  51. if flying and bv then
  52. -- move upward slowly
  53. bv.MaxForce = Vector3.new(4000, 4000, 4000)
  54. bv.Velocity = Vector3.new(0, 25, 0)
  55. end
  56. end)
Add Comment
Please, Sign In to add comment