Advertisement
pastebin2rblxscripts

FE Fly Script

May 28th, 2024
923
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local loadstringScript = [[
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local FlyEvent = ReplicatedStorage:FindFirstChild("FlyEvent")
  4.  
  5. if not FlyEvent then
  6.     FlyEvent = Instance.new("RemoteEvent", ReplicatedStorage)
  7.     FlyEvent.Name = "FlyEvent"
  8. end
  9.  
  10. local function toggleFly(player, isFlying)
  11.     local character = player.Character
  12.     if character then
  13.         local humanoid = character:FindFirstChildOfClass("Humanoid")
  14.         if humanoid then
  15.             if isFlying then
  16.                 humanoid.PlatformStand = true
  17.                 character.HumanoidRootPart.Anchored = true
  18.             else
  19.                 humanoid.PlatformStand = false
  20.                 character.HumanoidRootPart.Anchored = false
  21.             end
  22.         end
  23.     end
  24. end
  25.  
  26. FlyEvent.OnServerEvent:Connect(toggleFly)
  27. ]]
  28.  
  29. loadstring(loadstringScript)()
  30.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement