Advertisement
Semen4ik_123

TestFlyFalse

Jul 4th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.69 KB | None | 0 0
  1. --Not made by me
  2. --By lindsay on v3rmillion
  3. _G.FLYING = false
  4. local LP = game:service('Players').LocalPlayer
  5. local T = LP.Character.UpperTorso
  6. local CONTROL = {F = 0, B = 0, L = 0, R = 0}
  7. local lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  8. local SPEED = 5
  9. local MOUSE = LP:GetMouse()
  10.  
  11.  
  12. local function FLY()
  13.     _G.FLYING = false
  14.     local BG = Instance.new('BodyGyro', T)
  15.     local BV = Instance.new('BodyVelocity', T)
  16.     BG.P = 9e4
  17.     BG.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  18.     BG.cframe = T.CFrame
  19.     BV.velocity = Vector3.new(0, 0.1, 0)
  20.     BV.maxForce = Vector3.new(9e9, 9e9, 9e9)
  21.  
  22.  
  23.     spawn(function()
  24.       repeat wait()
  25.         LP.Character.Humanoid.PlatformStand = true
  26.         if CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0 then
  27.           SPEED = 50
  28.         elseif not (CONTROL.L + CONTROL.R ~= 0 or CONTROL.F + CONTROL.B ~= 0) and SPEED ~= 0 then
  29.           SPEED = 0
  30.         end
  31.         if (CONTROL.L + CONTROL.R) ~= 0 or (CONTROL.F + CONTROL.B) ~= 0 then
  32.           BV.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (CONTROL.F + CONTROL.B)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(CONTROL.L + CONTROL.R, (CONTROL.F + CONTROL.B) * 0.2, 0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  33.           lCONTROL = {F = CONTROL.F, B = CONTROL.B, L = CONTROL.L, R = CONTROL.R}
  34.         elseif (CONTROL.L + CONTROL.R) == 0 and (CONTROL.F + CONTROL.B) == 0 and SPEED ~= 0 then
  35.           BV.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lCONTROL.F + lCONTROL.B)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lCONTROL.L + lCONTROL.R, (lCONTROL.F + lCONTROL.B) * 0.2, 0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p)) * SPEED
  36.         else
  37.           BV.velocity = Vector3.new(0, 0.1, 0)
  38.         end
  39.         BG.cframe = game.Workspace.CurrentCamera.CoordinateFrame
  40.       until not _G.FLYING
  41.       CONTROL = {F = 0, B = 0, L = 0, R = 0}
  42.       lCONTROL = {F = 0, B = 0, L = 0, R = 0}
  43.       SPEED = 0
  44.       BG:destroy()
  45.       BV:destroy()
  46.       LP.Character.Humanoid.PlatformStand = false
  47.     end)
  48.   end
  49.  
  50.   MOUSE.KeyDown:connect(function(KEY)
  51.     if KEY:lower() == 'w' then
  52.       CONTROL.F = 1
  53.     elseif KEY:lower() == 's' then
  54.       CONTROL.B = -1
  55.     elseif KEY:lower() == 'a' then
  56.       CONTROL.L = -1
  57.     elseif KEY:lower() == 'd' then
  58.       CONTROL.R = 1
  59.     end
  60.   end)
  61.  
  62.   MOUSE.KeyUp:connect(function(KEY)
  63.     if KEY:lower() == 'w' then
  64.       CONTROL.F = 0
  65.     elseif KEY:lower() == 's' then
  66.       CONTROL.B = 0
  67.     elseif KEY:lower() == 'a' then
  68.       CONTROL.L = 0
  69.     elseif KEY:lower() == 'd' then
  70.       CONTROL.R = 0
  71.     end
  72.   end)
  73.  
  74.  
  75.  
  76.  
  77.   FLY()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement