Facebook
From Innocent Leopard, 4 Weeks ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 42
  1. local cesna = workspace:WaitForChild("Cessna 172")
  2. local rs = game:GetService("RunService")
  3. local propeller = cesna:WaitForChild("Propeller")
  4. --local speed = 0  -- Number has to be from 1 to 10 times 10
  5. local direction = cesna:WaitForChild("Direction")
  6. local repstrg = game:GetService("ReplicatedStorage")
  7. local spin = repstrg:WaitForChild("Spin")
  8. local move = repstrg:WaitForChild("Move")
  9. local nosedown = repstrg:WaitForChild("NoseDown")
  10. local noseup = repstrg:WaitForChild("NoseUp")
  11. local turnright = repstrg:WaitForChild("TurnRight")
  12. local turnleft = repstrg:WaitForChild("TurnLeft")
  13. local body = cesna:WaitForChild("Body")
  14. local seat = cesna:WaitForChild("Seat")
  15. local campart = cesna:WaitForChild("CameraPart")
  16. local knot = 1000
  17. local spinning = false
  18. local brakes = false
  19. local sped = 10
  20. local bg
  21. local bv
  22. local bav
  23. local pilotin = false
  24.  
  25. local inmode = false
  26.  
  27. function spinningblade(spd)
  28.         while spinning == true do
  29.                 propeller.CFrame = propeller.CFrame * CFrame.fromEulerAnglesXYZ(spd,0.0,0.0)--changed it
  30.                 wait()
  31.         end
  32. end
  33.  
  34. spin.OnServerEvent:Connect(function(plr, speed)
  35.         spinning = not spinning
  36.         spinningblade(speed)
  37. end)
  38.  
  39.  
  40.  
  41.  
  42.  
  43. move.OnServerEvent:Connect(function(plr)
  44.         while spinning == false and brakes == false and seat:FindFirstChild("SeatWeld") do
  45.                 pilotin = true
  46.                 wait()
  47.                 for i,v in pairs(cesna:GetChildren())do
  48.                         if v.Name == "Body" and v:FindFirstChild("BodyVelocity") == nil and v:FindFirstChild("BodyAngularVelocity") == nil then
  49.                                 bv = Instance.new("BodyVelocity")
  50.                                 bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  51.                                 bv.Parent = v
  52.                                
  53.                                
  54.                                
  55.                                 ------------
  56.                                
  57.                                 bg = Instance.new("BodyGyro")
  58.                                 bg.MaxTorque = Vector3.new(0,0,0)
  59.                                 bg.Parent = v
  60.                                
  61.                                 --------------
  62.                                
  63.                                 while wait(0.1) do
  64.                                         local x = direction.CFrame.LookVector.X*(knot/10)
  65.                                         local y = direction.CFrame.LookVector.Y*(knot/10) --direction.CFrame.LookVector.Y
  66.                                         local z = 0 --direction.CFrame.LookVector.Z
  67.                                         bv.Velocity = Vector3.new(x,y,z)
  68.                                 end
  69.                         end
  70.                 end
  71.         end
  72. end)
  73.  
  74.  
  75. noseup.OnServerEvent:Connect(function(plr, degree)  --pointing nose up
  76.         body.CFrame = body.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(degree))
  77. end)
  78.  
  79. nosedown.OnServerEvent:Connect(function(plr, degree) -- pointing nose down
  80.         body.CFrame = body.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-degree))
  81. end)
  82.  
  83. turnleft.OnServerEvent:Connect(function(plr, dg)
  84.         if pilotin == true then
  85.                 body.CFrame = body.CFrame * CFrame.Angles(math.rad(0),math.rad(dg),math.rad(0))
  86.         end
  87. end)
  88.  
  89. turnright.OnServerEvent:Connect(function(plr, dg)
  90.         if pilotin == true then
  91.                 body.CFrame = body.CFrame * CFrame.Angles(math.rad(0),math.rad(-dg),math.rad(0))
  92.         end
  93. end)
  94. --(direction.CFrame.LookVector*sped)