Advertisement
-----------------

plane test

May 13th, 2021
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 182.75 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. --Converted with ttyyuu12345's model to script plugin v4
  153. function sandbox(var,func)
  154. local env = getfenv(func)
  155. local newenv = setmetatable({},{
  156. __index = function(self,k)
  157. if k=="script" then
  158. return var
  159. else
  160. return env[k]
  161. end
  162. end,
  163. })
  164. setfenv(func,newenv)
  165. return func
  166. end
  167. cors = {}
  168. mas = Instance.new("Model",game:GetService("Lighting"))
  169. Model0 = Instance.new("Model")
  170. Model1 = Instance.new("Model")
  171. Model2 = Instance.new("Model")
  172. Model3 = Instance.new("Model")
  173. Part4 = Instance.new("Part")
  174. Part5 = Instance.new("Part")
  175. Part6 = Instance.new("Part")
  176. Part7 = Instance.new("Part")
  177. Part8 = Instance.new("Part")
  178. Part9 = Instance.new("Part")
  179. Part10 = Instance.new("Part")
  180. Seat11 = Instance.new("Seat")
  181. Part12 = Instance.new("Part")
  182. UnionOperation13 = Instance.new("UnionOperation")
  183. Model14 = Instance.new("Model")
  184. UnionOperation15 = Instance.new("UnionOperation")
  185. ObjectValue16 = Instance.new("ObjectValue")
  186. UnionOperation17 = Instance.new("UnionOperation")
  187. ObjectValue18 = Instance.new("ObjectValue")
  188. Part19 = Instance.new("Part")
  189. ObjectValue20 = Instance.new("ObjectValue")
  190. Part21 = Instance.new("Part")
  191. ObjectValue22 = Instance.new("ObjectValue")
  192. Part23 = Instance.new("Part")
  193. ObjectValue24 = Instance.new("ObjectValue")
  194. UnionOperation25 = Instance.new("UnionOperation")
  195. ObjectValue26 = Instance.new("ObjectValue")
  196. Model27 = Instance.new("Model")
  197. Part28 = Instance.new("Part")
  198. ObjectValue29 = Instance.new("ObjectValue")
  199. Part30 = Instance.new("Part")
  200. ObjectValue31 = Instance.new("ObjectValue")
  201. Part32 = Instance.new("Part")
  202. ObjectValue33 = Instance.new("ObjectValue")
  203. Part34 = Instance.new("Part")
  204. Sound35 = Instance.new("Sound")
  205. Sound36 = Instance.new("Sound")
  206. Sound37 = Instance.new("Sound")
  207. Sound38 = Instance.new("Sound")
  208. Sound39 = Instance.new("Sound")
  209. Fire40 = Instance.new("Fire")
  210. Smoke41 = Instance.new("Smoke")
  211. Sound42 = Instance.new("Sound")
  212. Part43 = Instance.new("Part")
  213. ObjectValue44 = Instance.new("ObjectValue")
  214. Part45 = Instance.new("Part")
  215. ObjectValue46 = Instance.new("ObjectValue")
  216. Part47 = Instance.new("Part")
  217. Script48 = Instance.new("Script")
  218. Script49 = Instance.new("Script")
  219. LocalScript50 = Instance.new("LocalScript")
  220. ObjectValue51 = Instance.new("ObjectValue")
  221. BoolValue52 = Instance.new("BoolValue")
  222. ModuleScript53 = Instance.new("ModuleScript")
  223. ModuleScript54 = Instance.new("ModuleScript")
  224. ModuleScript55 = Instance.new("ModuleScript")
  225. ModuleScript56 = Instance.new("ModuleScript")
  226. ModuleScript57 = Instance.new("ModuleScript")
  227. RemoteEvent58 = Instance.new("RemoteEvent")
  228. RemoteEvent59 = Instance.new("RemoteEvent")
  229. ModuleScript60 = Instance.new("ModuleScript")
  230. ModuleScript61 = Instance.new("ModuleScript")
  231. ModuleScript62 = Instance.new("ModuleScript")
  232. ScreenGui63 = Instance.new("ScreenGui")
  233. Frame64 = Instance.new("Frame")
  234. TextLabel65 = Instance.new("TextLabel")
  235. Frame66 = Instance.new("Frame")
  236. Frame67 = Instance.new("Frame")
  237. TextButton68 = Instance.new("TextButton")
  238. TextLabel69 = Instance.new("TextLabel")
  239. TextLabel70 = Instance.new("TextLabel")
  240. Frame71 = Instance.new("Frame")
  241. TextLabel72 = Instance.new("TextLabel")
  242. TextLabel73 = Instance.new("TextLabel")
  243. Frame74 = Instance.new("Frame")
  244. TextLabel75 = Instance.new("TextLabel")
  245. TextLabel76 = Instance.new("TextLabel")
  246. ModuleScript77 = Instance.new("ModuleScript")
  247. ScreenGui78 = Instance.new("ScreenGui")
  248. Frame79 = Instance.new("Frame")
  249. TextLabel80 = Instance.new("TextLabel")
  250. Frame81 = Instance.new("Frame")
  251. Frame82 = Instance.new("Frame")
  252. TextButton83 = Instance.new("TextButton")
  253. TextLabel84 = Instance.new("TextLabel")
  254. TextLabel85 = Instance.new("TextLabel")
  255. Frame86 = Instance.new("Frame")
  256. TextLabel87 = Instance.new("TextLabel")
  257. TextLabel88 = Instance.new("TextLabel")
  258. Frame89 = Instance.new("Frame")
  259. TextLabel90 = Instance.new("TextLabel")
  260. TextLabel91 = Instance.new("TextLabel")
  261. ModuleScript92 = Instance.new("ModuleScript")
  262. TextButton93 = Instance.new("TextButton")
  263. Frame94 = Instance.new("Frame")
  264. TextLabel95 = Instance.new("TextLabel")
  265. TextButton96 = Instance.new("TextButton")
  266. Frame97 = Instance.new("Frame")
  267. Frame98 = Instance.new("Frame")
  268. TextLabel99 = Instance.new("TextLabel")
  269. TextLabel100 = Instance.new("TextLabel")
  270. Frame101 = Instance.new("Frame")
  271. Frame102 = Instance.new("Frame")
  272. TextLabel103 = Instance.new("TextLabel")
  273. TextLabel104 = Instance.new("TextLabel")
  274. Frame105 = Instance.new("Frame")
  275. Frame106 = Instance.new("Frame")
  276. TextLabel107 = Instance.new("TextLabel")
  277. TextLabel108 = Instance.new("TextLabel")
  278. Frame109 = Instance.new("Frame")
  279. Frame110 = Instance.new("Frame")
  280. TextLabel111 = Instance.new("TextLabel")
  281. TextLabel112 = Instance.new("TextLabel")
  282. Frame113 = Instance.new("Frame")
  283. Frame114 = Instance.new("Frame")
  284. TextLabel115 = Instance.new("TextLabel")
  285. TextButton116 = Instance.new("TextButton")
  286. Frame117 = Instance.new("Frame")
  287. TextLabel118 = Instance.new("TextLabel")
  288. Frame119 = Instance.new("Frame")
  289. Frame120 = Instance.new("Frame")
  290. TextLabel121 = Instance.new("TextLabel")
  291. TextLabel122 = Instance.new("TextLabel")
  292. Frame123 = Instance.new("Frame")
  293. Frame124 = Instance.new("Frame")
  294. TextLabel125 = Instance.new("TextLabel")
  295. TextLabel126 = Instance.new("TextLabel")
  296. Frame127 = Instance.new("Frame")
  297. Frame128 = Instance.new("Frame")
  298. TextLabel129 = Instance.new("TextLabel")
  299. TextLabel130 = Instance.new("TextLabel")
  300. Frame131 = Instance.new("Frame")
  301. Frame132 = Instance.new("Frame")
  302. TextLabel133 = Instance.new("TextLabel")
  303. TextLabel134 = Instance.new("TextLabel")
  304. Frame135 = Instance.new("Frame")
  305. Frame136 = Instance.new("Frame")
  306. TextLabel137 = Instance.new("TextLabel")
  307. TextButton138 = Instance.new("TextButton")
  308. Frame139 = Instance.new("Frame")
  309. TextLabel140 = Instance.new("TextLabel")
  310. ScreenGui141 = Instance.new("ScreenGui")
  311. Frame142 = Instance.new("Frame")
  312. TextLabel143 = Instance.new("TextLabel")
  313. Frame144 = Instance.new("Frame")
  314. Frame145 = Instance.new("Frame")
  315. TextButton146 = Instance.new("TextButton")
  316. Frame147 = Instance.new("Frame")
  317. TextLabel148 = Instance.new("TextLabel")
  318. TextLabel149 = Instance.new("TextLabel")
  319. Frame150 = Instance.new("Frame")
  320. TextLabel151 = Instance.new("TextLabel")
  321. TextLabel152 = Instance.new("TextLabel")
  322. ModuleScript153 = Instance.new("ModuleScript")
  323. Frame154 = Instance.new("Frame")
  324. Frame155 = Instance.new("Frame")
  325. TextButton156 = Instance.new("TextButton")
  326. TextLabel157 = Instance.new("TextLabel")
  327. Frame158 = Instance.new("Frame")
  328. Frame159 = Instance.new("Frame")
  329. TextButton160 = Instance.new("TextButton")
  330. TextLabel161 = Instance.new("TextLabel")
  331. TextButton162 = Instance.new("TextButton")
  332. TextButton163 = Instance.new("TextButton")
  333. BoolValue164 = Instance.new("BoolValue")
  334. Script165 = Instance.new("Script")
  335. DoubleConstrainedValue166 = Instance.new("DoubleConstrainedValue")
  336. BoolValue167 = Instance.new("BoolValue")
  337. ModuleScript168 = Instance.new("ModuleScript")
  338. ModuleScript169 = Instance.new("ModuleScript")
  339. ModuleScript170 = Instance.new("ModuleScript")
  340. Model171 = Instance.new("Model")
  341. Model172 = Instance.new("Model")
  342. UnionOperation173 = Instance.new("UnionOperation")
  343. ObjectValue174 = Instance.new("ObjectValue")
  344. UnionOperation175 = Instance.new("UnionOperation")
  345. ObjectValue176 = Instance.new("ObjectValue")
  346. Part177 = Instance.new("Part")
  347. Part178 = Instance.new("Part")
  348. Model179 = Instance.new("Model")
  349. Part180 = Instance.new("Part")
  350. Part181 = Instance.new("Part")
  351. Part182 = Instance.new("Part")
  352. Part183 = Instance.new("Part")
  353. Part184 = Instance.new("Part")
  354. Part185 = Instance.new("Part")
  355. Part186 = Instance.new("Part")
  356. Part187 = Instance.new("Part")
  357. Part188 = Instance.new("Part")
  358. ObjectValue189 = Instance.new("ObjectValue")
  359. Part190 = Instance.new("Part")
  360. Model191 = Instance.new("Model")
  361. UnionOperation192 = Instance.new("UnionOperation")
  362. Part193 = Instance.new("Part")
  363. HingeConstraint194 = Instance.new("HingeConstraint")
  364. Part195 = Instance.new("Part")
  365. HingeConstraint196 = Instance.new("HingeConstraint")
  366. Model197 = Instance.new("Model")
  367. Part198 = Instance.new("Part")
  368. ObjectValue199 = Instance.new("ObjectValue")
  369. Part200 = Instance.new("Part")
  370. ObjectValue201 = Instance.new("ObjectValue")
  371. Part202 = Instance.new("Part")
  372. ObjectValue203 = Instance.new("ObjectValue")
  373. Part204 = Instance.new("Part")
  374. ObjectValue205 = Instance.new("ObjectValue")
  375. Part206 = Instance.new("Part")
  376. SurfaceGui207 = Instance.new("SurfaceGui")
  377. TextLabel208 = Instance.new("TextLabel")
  378. Script209 = Instance.new("Script")
  379. Script210 = Instance.new("Script")
  380. Model0.Name = "PlaneSystem"
  381. Model0.Parent = mas
  382. Model1.Name = "Plane"
  383. Model1.Parent = Model0
  384. Model2.Name = "Functional"
  385. Model2.Parent = Model1
  386. Model3.Name = "ControlSurfaces"
  387. Model3.Parent = Model2
  388. Part4.Name = "AileronBottomLeft"
  389. Part4.Parent = Model3
  390. Part4.CFrame = CFrame.new(-39.1004105, 5.48902893, 66.1998901, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  391. Part4.Orientation = Vector3.new(0, 180, 0)
  392. Part4.Position = Vector3.new(-39.1004105, 5.48902893, 66.1998901)
  393. Part4.Rotation = Vector3.new(180, 0, 180)
  394. Part4.Color = Color3.new(0.498039, 0.556863, 0.392157)
  395. Part4.Size = Vector3.new(6.1999979, 0.200000003, 2.39999986)
  396. Part4.Anchored = true
  397. Part4.BottomSurface = Enum.SurfaceType.Smooth
  398. Part4.BrickColor = BrickColor.new("Grime")
  399. Part4.CanCollide = false
  400. Part4.TopSurface = Enum.SurfaceType.Smooth
  401. Part4.brickColor = BrickColor.new("Grime")
  402. Part5.Name = "AileronBottomRight"
  403. Part5.Parent = Model3
  404. Part5.CFrame = CFrame.new(-72.8997955, 5.48902893, 66.199585, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  405. Part5.Orientation = Vector3.new(0, 180, 0)
  406. Part5.Position = Vector3.new(-72.8997955, 5.48902893, 66.199585)
  407. Part5.Rotation = Vector3.new(180, 0, 180)
  408. Part5.Color = Color3.new(0.498039, 0.556863, 0.392157)
  409. Part5.Size = Vector3.new(6.1999979, 0.200000003, 2.39999986)
  410. Part5.Anchored = true
  411. Part5.BottomSurface = Enum.SurfaceType.Smooth
  412. Part5.BrickColor = BrickColor.new("Grime")
  413. Part5.CanCollide = false
  414. Part5.TopSurface = Enum.SurfaceType.Smooth
  415. Part5.brickColor = BrickColor.new("Grime")
  416. Part6.Name = "AileronTopLeft"
  417. Part6.Parent = Model3
  418. Part6.CFrame = CFrame.new(-39.2004013, 11.4888668, 64.3999023, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  419. Part6.Orientation = Vector3.new(0, 180, 0)
  420. Part6.Position = Vector3.new(-39.2004013, 11.4888668, 64.3999023)
  421. Part6.Rotation = Vector3.new(180, 0, 180)
  422. Part6.Color = Color3.new(0.498039, 0.556863, 0.392157)
  423. Part6.Size = Vector3.new(6.39999771, 0.200000003, 2.39999986)
  424. Part6.Anchored = true
  425. Part6.BottomSurface = Enum.SurfaceType.Smooth
  426. Part6.BrickColor = BrickColor.new("Grime")
  427. Part6.CanCollide = false
  428. Part6.TopSurface = Enum.SurfaceType.Smooth
  429. Part6.brickColor = BrickColor.new("Grime")
  430. Part7.Name = "AileronTopRight"
  431. Part7.Parent = Model3
  432. Part7.CFrame = CFrame.new(-72.7997284, 11.4888706, 64.3999634, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  433. Part7.Orientation = Vector3.new(0, 180, 0)
  434. Part7.Position = Vector3.new(-72.7997284, 11.4888706, 64.3999634)
  435. Part7.Rotation = Vector3.new(180, 0, 180)
  436. Part7.Color = Color3.new(0.498039, 0.556863, 0.392157)
  437. Part7.Size = Vector3.new(6.39999771, 0.200000003, 2.39999986)
  438. Part7.Anchored = true
  439. Part7.BottomSurface = Enum.SurfaceType.Smooth
  440. Part7.BrickColor = BrickColor.new("Grime")
  441. Part7.CanCollide = false
  442. Part7.TopSurface = Enum.SurfaceType.Smooth
  443. Part7.brickColor = BrickColor.new("Grime")
  444. Part8.Name = "ElevatorLeft"
  445. Part8.Parent = Model3
  446. Part8.CFrame = CFrame.new(-53.2001152, 6.98896503, 45.7995605, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  447. Part8.Orientation = Vector3.new(0, 180, 0)
  448. Part8.Position = Vector3.new(-53.2001152, 6.98896503, 45.7995605)
  449. Part8.Rotation = Vector3.new(180, 0, 180)
  450. Part8.Color = Color3.new(0.498039, 0.556863, 0.392157)
  451. Part8.Size = Vector3.new(4.5999999, 0.200000003, 2)
  452. Part8.Anchored = true
  453. Part8.BottomSurface = Enum.SurfaceType.Smooth
  454. Part8.BrickColor = BrickColor.new("Grime")
  455. Part8.TopSurface = Enum.SurfaceType.Smooth
  456. Part8.brickColor = BrickColor.new("Grime")
  457. Part9.Name = "ElevatorRight"
  458. Part9.Parent = Model3
  459. Part9.CFrame = CFrame.new(-58.8000603, 6.98896408, 45.7997437, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  460. Part9.Orientation = Vector3.new(0, 180, 0)
  461. Part9.Position = Vector3.new(-58.8000603, 6.98896408, 45.7997437)
  462. Part9.Rotation = Vector3.new(180, 0, 180)
  463. Part9.Color = Color3.new(0.498039, 0.556863, 0.392157)
  464. Part9.Size = Vector3.new(4.5999999, 0.200000003, 2)
  465. Part9.Anchored = true
  466. Part9.BottomSurface = Enum.SurfaceType.Smooth
  467. Part9.BrickColor = BrickColor.new("Grime")
  468. Part9.TopSurface = Enum.SurfaceType.Smooth
  469. Part9.brickColor = BrickColor.new("Grime")
  470. Part10.Name = "Rudder"
  471. Part10.Parent = Model3
  472. Part10.CFrame = CFrame.new(-56.0001335, 8.48893166, 45.199585, -1.67546896e-05, 1.00000048, 3.51518673e-20, 1.00000012, 1.67547405e-05, -4.65661287e-10, 4.65661287e-10, 3.90105217e-15, -1)
  473. Part10.Orientation = Vector3.new(0, 180, 90)
  474. Part10.Position = Vector3.new(-56.0001335, 8.48893166, 45.199585)
  475. Part10.Rotation = Vector3.new(180, 0, -90)
  476. Part10.Color = Color3.new(0.639216, 0.294118, 0.294118)
  477. Part10.Size = Vector3.new(3.20000005, 0.200000003, 2)
  478. Part10.Anchored = true
  479. Part10.BottomSurface = Enum.SurfaceType.Smooth
  480. Part10.BrickColor = BrickColor.new("Dusty Rose")
  481. Part10.TopSurface = Enum.SurfaceType.Smooth
  482. Part10.brickColor = BrickColor.new("Dusty Rose")
  483. Seat11.Name = "PilotSeat"
  484. Seat11.Parent = Model2
  485. Seat11.CFrame = CFrame.new(-56.0000725, 6.68897247, 66.1999512, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  486. Seat11.Orientation = Vector3.new(0, 180, 0)
  487. Seat11.Position = Vector3.new(-56.0000725, 6.68897247, 66.1999512)
  488. Seat11.Rotation = Vector3.new(180, 0, 180)
  489. Seat11.Color = Color3.new(0.972549, 0.972549, 0.972549)
  490. Seat11.Size = Vector3.new(2, 0.600000024, 2)
  491. Seat11.Disabled = true
  492. Seat11.Anchored = true
  493. Seat11.BottomSurface = Enum.SurfaceType.Smooth
  494. Seat11.BrickColor = BrickColor.new("Institutional white")
  495. Seat11.Material = Enum.Material.Fabric
  496. Seat11.TopSurface = Enum.SurfaceType.Smooth
  497. Seat11.brickColor = BrickColor.new("Institutional white")
  498. Part12.Name = "Joystick"
  499. Part12.Parent = Model2
  500. Part12.CFrame = CFrame.new(-56.0001335, 7.38897705, 67.4998169, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  501. Part12.Orientation = Vector3.new(0, 180, 0)
  502. Part12.Position = Vector3.new(-56.0001335, 7.38897705, 67.4998169)
  503. Part12.Rotation = Vector3.new(180, 0, 180)
  504. Part12.Color = Color3.new(0.486275, 0.360784, 0.27451)
  505. Part12.Size = Vector3.new(0.200000003, 2, 0.200000003)
  506. Part12.Anchored = true
  507. Part12.BottomSurface = Enum.SurfaceType.Smooth
  508. Part12.BrickColor = BrickColor.new("Brown")
  509. Part12.Material = Enum.Material.Wood
  510. Part12.TopSurface = Enum.SurfaceType.Smooth
  511. Part12.brickColor = BrickColor.new("Brown")
  512. UnionOperation13.Name = "Propeller"
  513. UnionOperation13.Parent = Model2
  514. UnionOperation13.CFrame = CFrame.new(-55.9999962, 7.38897514, 72.5, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  515. UnionOperation13.Orientation = Vector3.new(0, 180, 0)
  516. UnionOperation13.Position = Vector3.new(-55.9999962, 7.38897514, 72.5)
  517. UnionOperation13.Rotation = Vector3.new(180, 0, 180)
  518. UnionOperation13.Color = Color3.new(0.486275, 0.360784, 0.27451)
  519. UnionOperation13.Size = Vector3.new(12, 1.00000215, 1)
  520. UnionOperation13.Anchored = true
  521. UnionOperation13.BrickColor = BrickColor.new("Brown")
  522. UnionOperation13.CanCollide = false
  523. UnionOperation13.Material = Enum.Material.Wood
  524. UnionOperation13.brickColor = BrickColor.new("Brown")
  525. UnionOperation13.UsePartColor = true
  526. Model14.Name = "StaticAirFoils"
  527. Model14.Parent = Model2
  528. UnionOperation15.Name = "WingBottomRight"
  529. UnionOperation15.Parent = Model14
  530. UnionOperation15.CFrame = CFrame.new(-66.9998474, 5.48902512, 68.000061, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  531. UnionOperation15.Orientation = Vector3.new(0, 180, 0)
  532. UnionOperation15.Position = Vector3.new(-66.9998474, 5.48902512, 68.000061)
  533. UnionOperation15.Rotation = Vector3.new(180, 0, 180)
  534. UnionOperation15.Color = Color3.new(0.498039, 0.556863, 0.392157)
  535. UnionOperation15.Size = Vector3.new(18, 0.20000416, 6)
  536. UnionOperation15.Anchored = true
  537. UnionOperation15.BrickColor = BrickColor.new("Grime")
  538. UnionOperation15.brickColor = BrickColor.new("Grime")
  539. UnionOperation15.UsePartColor = true
  540. ObjectValue16.Name = "DamageCollider"
  541. ObjectValue16.Parent = UnionOperation15
  542. UnionOperation17.Name = "WingBottomLeft"
  543. UnionOperation17.Parent = Model14
  544. UnionOperation17.CFrame = CFrame.new(-45.0000725, 5.48903084, 67.9997559, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  545. UnionOperation17.Orientation = Vector3.new(0, 180, 0)
  546. UnionOperation17.Position = Vector3.new(-45.0000725, 5.48903084, 67.9997559)
  547. UnionOperation17.Rotation = Vector3.new(180, 0, 180)
  548. UnionOperation17.Color = Color3.new(0.498039, 0.556863, 0.392157)
  549. UnionOperation17.Size = Vector3.new(18.0000019, 0.200001583, 6.00000191)
  550. UnionOperation17.Anchored = true
  551. UnionOperation17.BrickColor = BrickColor.new("Grime")
  552. UnionOperation17.brickColor = BrickColor.new("Grime")
  553. UnionOperation17.UsePartColor = true
  554. ObjectValue18.Name = "DamageCollider"
  555. ObjectValue18.Parent = UnionOperation17
  556. Part19.Name = "HorizontalStabilizerLeft"
  557. Part19.Parent = Model14
  558. Part19.CFrame = CFrame.new(-53.3999443, 6.9889698, 47.7996216, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  559. Part19.Orientation = Vector3.new(0, 180, 0)
  560. Part19.Position = Vector3.new(-53.3999443, 6.9889698, 47.7996216)
  561. Part19.Rotation = Vector3.new(180, 0, 180)
  562. Part19.Color = Color3.new(0.498039, 0.556863, 0.392157)
  563. Part19.Size = Vector3.new(5, 0.200000003, 2)
  564. Part19.Anchored = true
  565. Part19.BottomSurface = Enum.SurfaceType.Smooth
  566. Part19.BrickColor = BrickColor.new("Grime")
  567. Part19.TopSurface = Enum.SurfaceType.Smooth
  568. Part19.brickColor = BrickColor.new("Grime")
  569. ObjectValue20.Name = "DamageCollider"
  570. ObjectValue20.Parent = Part19
  571. Part21.Name = "HorizontalStabilizerRight"
  572. Part21.Parent = Model14
  573. Part21.CFrame = CFrame.new(-58.6000481, 6.9889698, 47.7997437, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  574. Part21.Orientation = Vector3.new(0, 180, 0)
  575. Part21.Position = Vector3.new(-58.6000481, 6.9889698, 47.7997437)
  576. Part21.Rotation = Vector3.new(180, 0, 180)
  577. Part21.Color = Color3.new(0.498039, 0.556863, 0.392157)
  578. Part21.Size = Vector3.new(5, 0.200000003, 2)
  579. Part21.Anchored = true
  580. Part21.BottomSurface = Enum.SurfaceType.Smooth
  581. Part21.BrickColor = BrickColor.new("Grime")
  582. Part21.TopSurface = Enum.SurfaceType.Smooth
  583. Part21.brickColor = BrickColor.new("Grime")
  584. ObjectValue22.Name = "DamageCollider"
  585. ObjectValue22.Parent = Part21
  586. Part23.Name = "VerticalStabilizer"
  587. Part23.Parent = Model14
  588. Part23.CFrame = CFrame.new(-56.0002556, 9.38890362, 47.1998901, -1.67546896e-05, 1.00000048, 3.51518673e-20, 1.00000012, 1.67547405e-05, -4.65661287e-10, 4.65661287e-10, 3.90105217e-15, -1)
  589. Part23.Orientation = Vector3.new(0, 180, 90)
  590. Part23.Position = Vector3.new(-56.0002556, 9.38890362, 47.1998901)
  591. Part23.Rotation = Vector3.new(180, 0, -90)
  592. Part23.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  593. Part23.Size = Vector3.new(3, 0.200000003, 2)
  594. Part23.Anchored = true
  595. Part23.BottomSurface = Enum.SurfaceType.Smooth
  596. Part23.BrickColor = BrickColor.new("Cyan")
  597. Part23.TopSurface = Enum.SurfaceType.Smooth
  598. Part23.brickColor = BrickColor.new("Cyan")
  599. ObjectValue24.Name = "DamageCollider"
  600. ObjectValue24.Parent = Part23
  601. UnionOperation25.Name = "WingTop"
  602. UnionOperation25.Parent = Model14
  603. UnionOperation25.CFrame = CFrame.new(-56.000164, 11.4888725, 66.1998291, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  604. UnionOperation25.Orientation = Vector3.new(0, 180, 0)
  605. UnionOperation25.Position = Vector3.new(-56.000164, 11.4888725, 66.1998291)
  606. UnionOperation25.Rotation = Vector3.new(180, 0, 180)
  607. UnionOperation25.Color = Color3.new(0.498039, 0.556863, 0.392157)
  608. UnionOperation25.Size = Vector3.new(40, 0.200006351, 6.00000095)
  609. UnionOperation25.Anchored = true
  610. UnionOperation25.BrickColor = BrickColor.new("Grime")
  611. UnionOperation25.brickColor = BrickColor.new("Grime")
  612. UnionOperation25.UsePartColor = true
  613. ObjectValue26.Name = "DamageCollider"
  614. ObjectValue26.Parent = UnionOperation25
  615. Model27.Name = "Engine"
  616. Model27.Parent = Model2
  617. Part28.Name = "EnginePart"
  618. Part28.Parent = Model27
  619. Part28.CFrame = CFrame.new(-57.6998863, 7.38896847, 71.2999268, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  620. Part28.Orientation = Vector3.new(0, 180, 0)
  621. Part28.Position = Vector3.new(-57.6998863, 7.38896847, 71.2999268)
  622. Part28.Rotation = Vector3.new(180, 0, 180)
  623. Part28.Color = Color3.new(0.803922, 0.803922, 0.803922)
  624. Part28.Size = Vector3.new(0.599999905, 4, 1.80000007)
  625. Part28.Anchored = true
  626. Part28.BottomSurface = Enum.SurfaceType.Smooth
  627. Part28.BrickColor = BrickColor.new("Mid gray")
  628. Part28.Material = Enum.Material.SmoothPlastic
  629. Part28.Reflectance = 0.30000001192093
  630. Part28.TopSurface = Enum.SurfaceType.Smooth
  631. Part28.brickColor = BrickColor.new("Mid gray")
  632. ObjectValue29.Name = "DamageCollider"
  633. ObjectValue29.Parent = Part28
  634. Part30.Name = "EnginePart"
  635. Part30.Parent = Model27
  636. Part30.CFrame = CFrame.new(-56.000164, 9.08894634, 71.2999268, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  637. Part30.Orientation = Vector3.new(0, 180, 0)
  638. Part30.Position = Vector3.new(-56.000164, 9.08894634, 71.2999268)
  639. Part30.Rotation = Vector3.new(180, 0, 180)
  640. Part30.Color = Color3.new(0.803922, 0.803922, 0.803922)
  641. Part30.Size = Vector3.new(2.79999995, 0.600000024, 1.80000007)
  642. Part30.Anchored = true
  643. Part30.BottomSurface = Enum.SurfaceType.Smooth
  644. Part30.BrickColor = BrickColor.new("Mid gray")
  645. Part30.Material = Enum.Material.SmoothPlastic
  646. Part30.Reflectance = 0.30000001192093
  647. Part30.TopSurface = Enum.SurfaceType.Smooth
  648. Part30.brickColor = BrickColor.new("Mid gray")
  649. ObjectValue31.Name = "DamageCollider"
  650. ObjectValue31.Parent = Part30
  651. Part32.Name = "EnginePart"
  652. Part32.Parent = Model27
  653. Part32.CFrame = CFrame.new(-56.0000572, 5.68899727, 71.2999268, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  654. Part32.Orientation = Vector3.new(0, 180, 0)
  655. Part32.Position = Vector3.new(-56.0000572, 5.68899727, 71.2999268)
  656. Part32.Rotation = Vector3.new(180, 0, 180)
  657. Part32.Color = Color3.new(0.803922, 0.803922, 0.803922)
  658. Part32.Size = Vector3.new(2.79999995, 0.600000024, 1.80000007)
  659. Part32.Anchored = true
  660. Part32.BottomSurface = Enum.SurfaceType.Smooth
  661. Part32.BrickColor = BrickColor.new("Mid gray")
  662. Part32.Material = Enum.Material.SmoothPlastic
  663. Part32.Reflectance = 0.30000001192093
  664. Part32.TopSurface = Enum.SurfaceType.Smooth
  665. Part32.brickColor = BrickColor.new("Mid gray")
  666. ObjectValue33.Name = "DamageCollider"
  667. ObjectValue33.Parent = Part32
  668. Part34.Name = "EngineMain"
  669. Part34.Parent = Model27
  670. Part34.CFrame = CFrame.new(-56.0001183, 7.38898087, 71.6998291, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  671. Part34.Orientation = Vector3.new(0, 180, 0)
  672. Part34.Position = Vector3.new(-56.0001183, 7.38898087, 71.6998291)
  673. Part34.Rotation = Vector3.new(180, 0, 180)
  674. Part34.Color = Color3.new(0.803922, 0.803922, 0.803922)
  675. Part34.Size = Vector3.new(2.79999995, 2.80000019, 0.600000024)
  676. Part34.Anchored = true
  677. Part34.BottomSurface = Enum.SurfaceType.Smooth
  678. Part34.BrickColor = BrickColor.new("Mid gray")
  679. Part34.Material = Enum.Material.SmoothPlastic
  680. Part34.Reflectance = 0.30000001192093
  681. Part34.TopSurface = Enum.SurfaceType.Smooth
  682. Part34.brickColor = BrickColor.new("Mid gray")
  683. Sound35.Name = "Shutdown"
  684. Sound35.Parent = Part34
  685. Sound35.EmitterSize = 30
  686. Sound35.MinDistance = 30
  687. Sound35.SoundId = "rbxassetid://133922235"
  688. Sound36.Name = "Startup"
  689. Sound36.Parent = Part34
  690. Sound36.EmitterSize = 30
  691. Sound36.MinDistance = 30
  692. Sound36.SoundId = "rbxassetid://133859905"
  693. Sound37.Name = "Idle"
  694. Sound37.Parent = Part34
  695. Sound37.Looped = true
  696. Sound37.EmitterSize = 30
  697. Sound37.MinDistance = 30
  698. Sound37.SoundId = "rbxassetid://618990950"
  699. Sound38.Name = "LowThrottle"
  700. Sound38.Parent = Part34
  701. Sound38.Looped = true
  702. Sound38.EmitterSize = 30
  703. Sound38.MinDistance = 30
  704. Sound38.SoundId = "rbxassetid://618991005"
  705. Sound39.Name = "Flying"
  706. Sound39.Parent = Part34
  707. Sound39.Looped = true
  708. Sound39.EmitterSize = 30
  709. Sound39.MinDistance = 30
  710. Sound39.SoundId = "rbxassetid://618991252"
  711. Fire40.Parent = Part34
  712. Fire40.Enabled = false
  713. Fire40.Size = 20
  714. Fire40.Heat = 25
  715. Fire40.size = 20
  716. Smoke41.Parent = Part34
  717. Smoke41.Color = Color3.new(0.384314, 0.384314, 0.384314)
  718. Smoke41.Enabled = false
  719. Smoke41.Size = 10
  720. Smoke41.RiseVelocity = 10
  721. Sound42.Name = "Explosion"
  722. Sound42.Parent = Part34
  723. Sound42.EmitterSize = 40
  724. Sound42.MinDistance = 40
  725. Sound42.SoundId = "rbxassetid://413503439"
  726. Sound42.Volume = 1
  727. Part43.Name = "EnginePart"
  728. Part43.Parent = Model27
  729. Part43.CFrame = CFrame.new(-54.2999687, 7.38897419, 71.2998047, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  730. Part43.Orientation = Vector3.new(0, 180, 0)
  731. Part43.Position = Vector3.new(-54.2999687, 7.38897419, 71.2998047)
  732. Part43.Rotation = Vector3.new(180, 0, 180)
  733. Part43.Color = Color3.new(0.803922, 0.803922, 0.803922)
  734. Part43.Size = Vector3.new(0.599999905, 4, 1.80000007)
  735. Part43.Anchored = true
  736. Part43.BottomSurface = Enum.SurfaceType.Smooth
  737. Part43.BrickColor = BrickColor.new("Mid gray")
  738. Part43.Material = Enum.Material.SmoothPlastic
  739. Part43.Reflectance = 0.30000001192093
  740. Part43.TopSurface = Enum.SurfaceType.Smooth
  741. Part43.brickColor = BrickColor.new("Mid gray")
  742. ObjectValue44.Name = "DamageCollider"
  743. ObjectValue44.Parent = Part43
  744. Part45.Name = "Nose"
  745. Part45.Parent = Model27
  746. Part45.CFrame = CFrame.new(-55.9999962, 7.38897514, 72.5, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  747. Part45.Orientation = Vector3.new(0, 180, 0)
  748. Part45.Position = Vector3.new(-55.9999962, 7.38897514, 72.5)
  749. Part45.Rotation = Vector3.new(180, 0, 180)
  750. Part45.Transparency = 1
  751. Part45.Size = Vector3.new(2, 2, 2)
  752. Part45.Anchored = true
  753. Part45.BottomSurface = Enum.SurfaceType.Smooth
  754. Part45.TopSurface = Enum.SurfaceType.Smooth
  755. Part45.Shape = Enum.PartType.Ball
  756. ObjectValue46.Name = "DamageCollider"
  757. ObjectValue46.Parent = Part45
  758. Part47.Name = "TailSkid"
  759. Part47.Parent = Model2
  760. Part47.CFrame = CFrame.new(-55.9998741, 5.96219826, 48.9996948, -1.00000048, 3.34913375e-10, 8.55832738e-10, 3.01952296e-10, 0.866017938, 0.500013113, 3.51518673e-20, 0.500013173, -0.866017938)
  761. Part47.Orientation = Vector3.new(-30, 180, 0)
  762. Part47.Position = Vector3.new(-55.9998741, 5.96219826, 48.9996948)
  763. Part47.Rotation = Vector3.new(-150, 0, -180)
  764. Part47.Color = Color3.new(0.486275, 0.360784, 0.27451)
  765. Part47.Size = Vector3.new(0.200000003, 2.60000014, 0.200000003)
  766. Part47.Anchored = true
  767. Part47.BottomSurface = Enum.SurfaceType.Smooth
  768. Part47.BrickColor = BrickColor.new("Brown")
  769. Part47.Material = Enum.Material.Wood
  770. Part47.TopSurface = Enum.SurfaceType.Smooth
  771. Part47.brickColor = BrickColor.new("Brown")
  772. Script48.Name = "Welder"
  773. Script48.Parent = Model1
  774. table.insert(cors,sandbox(Script48,function()
  775. -- Welder
  776. -- Crazyman32
  777. -- January 18, 2017
  778.  
  779. --[[
  780.  
  781. Welds the plane together! Also creates special welds
  782. for animations, which are designated by Attachment
  783. objects named "AnimatedAttchment" within parts.
  784.  
  785. Animations are done with a bit of trickery. Since I
  786. want to simply rotate the welds in order to rotate
  787. surface control parts, I came up with a design that
  788. creates two "joint" parts at the location of the
  789. AnimatedAttachment object. One of the joints is
  790. auto-welded to the primary part of the plane. The
  791. other joint is welded directly to the first joint.
  792. This second joint will contain the "animate" weld
  793. object that can simply be rotated to move the surface.
  794. Finally, the control surface itself is auto-welded
  795. to the second joint, so that moving the second joint
  796. will move the control surface.
  797.  
  798. To break that paragraph down in steps:
  799.  
  800. 1. Create 2 "joint" parts (J1 and J2), both at the location of AnimatedAttachment
  801. 2. Auto-weld J1 to the plane
  802. 3. Weld J2 directly to J1
  803. 4. Auto-weld the control surface to J2
  804. 5. Use the J2 weld to animate the control surface by setting it's C0 cframe property
  805.  
  806. --]]
  807.  
  808.  
  809.  
  810. local plane = script.Parent
  811.  
  812. local readyToWeld = plane:WaitForChild("ReadyToWeld")
  813. while (not readyToWeld.Value) do wait() end
  814. readyToWeld:Destroy()
  815. readyToWeld = nil
  816.  
  817. -- Don't weld any parts that have the following names in ignore table:
  818. local ignore = {
  819.  
  820. -- Ignore the wheels because they use physics Hinges instead of welds:
  821. ["WheelLeft"] = true;
  822. ["WheelRight"] = true;
  823.  
  824. }
  825.  
  826. -- Set the "EngineMain" part as the PrimaryPart of the model: (super important for almost every other script in the system)
  827. local main = plane:WaitForChild("Functional"):WaitForChild("Engine"):WaitForChild("EngineMain")
  828. plane.PrimaryPart = main
  829.  
  830. -- Putting all the welds into this folder:
  831. local welds = Instance.new("Folder", plane)
  832. welds.Name = "Welds"
  833.  
  834. -- Putting all the animated welds into this folder:
  835. local animWelds = Instance.new("Folder", welds)
  836. animWelds.Name = "AnimatedWelds"
  837.  
  838. -- Putting all the joints into this model:
  839. local joints = Instance.new("Model", plane)
  840. joints.Name = "Joints"
  841.  
  842. -- Our Joint "prefab":
  843. local joint = Instance.new("Part")
  844. joint.Name = "Joint"
  845. joint.Anchored = true
  846. joint.CanCollide = false
  847. joint.Locked = true
  848. joint.Material = Enum.Material.SmoothPlastic
  849. joint.TopSurface = Enum.SurfaceType.Smooth
  850. joint.BottomSurface = Enum.SurfaceType.Smooth
  851. joint.Transparency = 1
  852. joint.Size = Vector3.new(0.4, 0.4, 0.4)
  853.  
  854.  
  855. -- Autoweld 'p0' to 'p1':
  856. function AutoWeldTo(p0, p1)
  857.  
  858. -- See ROBLOX Wiki page to understand how this works:
  859. -- http://wiki.roblox.com/index.php?title=Weld#Welding_together_two_existing_bricks
  860.  
  861. local w = Instance.new("Weld", welds)
  862. w.Name = "PlaneWeld"
  863. w.Part0, w.Part1 = p0, p1
  864. w.C0 = p0.CFrame:inverse() * p1.CFrame
  865.  
  866. end
  867.  
  868.  
  869. -- Auto-weld the given part to the 'main' part of the plane:
  870. function AutoWeld(part)
  871. AutoWeldTo(part, main)
  872. end
  873.  
  874.  
  875. -- Weld all descendants of 'parent':
  876. function Weld(parent)
  877. if (parent == joints) then return end
  878. for _,child in pairs(parent:GetChildren()) do
  879. if (child:IsA("BasePart") and child ~= main) then
  880.  
  881. local attachment = child:FindFirstChild("AnimatedAttachment")
  882.  
  883. -- Weld animated parts:
  884. if (attachment) then
  885.  
  886. local offset = attachment.Position
  887.  
  888. -- Joint1:
  889. local j1 = joint:Clone()
  890. j1.Parent = joints
  891. -- Sorry, this is gross! It places the joint at the position of the attachment:
  892. j1.CFrame = child.CFrame * CFrame.new(offset.X, offset.Y, offset.Z) * CFrame.Angles(math.rad(attachment.Rotation.X), math.rad(attachment.Rotation.Y), math.rad(attachment.Rotation.Z))
  893.  
  894. -- Joint2:
  895. local j2 = j1:Clone()
  896. j2.Parent = joints
  897.  
  898. -- The animated weld:
  899. local animWeld = Instance.new("Weld", animWelds)
  900. animWeld.Name = child.Name
  901. animWeld.Part0, animWeld.Part1 = j1, j2
  902.  
  903. AutoWeldTo(child, j2)
  904. AutoWeld(j1)
  905. j1.Anchored = false
  906. j2.Anchored = false
  907. attachment:Destroy()
  908.  
  909. -- Weld non-ignored and non-animated parts directly to the plane:
  910. elseif (not ignore[child.Name]) then
  911. AutoWeld(child)
  912. end
  913.  
  914. child.Anchored = false
  915.  
  916. end
  917. Weld(child)
  918. end
  919. end
  920.  
  921.  
  922. Weld(plane)
  923. main.Anchored = false
  924.  
  925. -- Mark as ready, so that the Controller script knows the plane is welded:
  926. local welded = Instance.new("ObjectValue")
  927. welded.Name = "Welded"
  928. welded.Parent = plane
  929. end))
  930. Script49.Name = "Controller"
  931. Script49.Parent = Model1
  932. table.insert(cors,sandbox(Script49,function()
  933. -- Controller
  934. -- Crazyman32
  935. -- January 18, 2017
  936.  
  937. --[[
  938.  
  939. This script has 2 primary purposes:
  940. 1) Handle players entering/leaving the pilot seat
  941. 2) Run flight physics if no player is present
  942.  
  943. When a player is flying the plane, the player's client
  944. handles the physics calculations. When the player leaves,
  945. the calculations need to be delegated back to the server,
  946. hence the 2nd purpose listed.
  947.  
  948. e.g. If the player is flying the plane and then leaves
  949. the server, this script will pick up the physics
  950. and properly continue to simulate the aircraft.
  951. --]]
  952.  
  953.  
  954. local plane = script.Parent
  955.  
  956. -- Wait for plane to be welded:
  957. plane:WaitForChild("Welded"):Destroy()
  958.  
  959. local main = plane.PrimaryPart
  960.  
  961. -- This is what powers the aircraft & is used by the Flyer module:
  962. local attachment = Instance.new("Attachment",main)
  963. local vector_force = Instance.new("VectorForce",main)
  964. vector_force.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
  965. vector_force.Attachment0 = attachment
  966.  
  967. local functional = plane:WaitForChild("Functional")
  968. local seat = functional:WaitForChild("PilotSeat")
  969.  
  970. local flyer = require(plane:WaitForChild("Flyer"))
  971. local localController = script:WaitForChild("LocalController")
  972.  
  973. local dead = plane:WaitForChild("Dead")
  974.  
  975. local pilot = nil
  976. local pilotController = nil
  977.  
  978. local updateHandler
  979.  
  980. function SetNetworkOwner(player)
  981. local function Scan(parent)
  982. for _,v in pairs(parent:GetChildren()) do
  983. if (v:IsA("BasePart")) then
  984. v:SetNetworkOwner(player)
  985. end
  986. Scan(v)
  987. end
  988. end
  989. Scan(plane)
  990. end
  991.  
  992. -- Server-side plane physics updates:
  993. function Update()
  994. flyer:Update()
  995. --[[
  996. if (not dead.Value) then
  997. flyer:UpdateControls()
  998. end
  999. ]]
  1000. end
  1001.  
  1002. function UpdateControls()
  1003. if (not dead.Value) then
  1004. flyer:UpdateControls()
  1005. end
  1006. end
  1007.  
  1008. -- Reset flyer inputs:
  1009. function ResetFlyer()
  1010. flyer.Throttle = 0
  1011. flyer.BankInput = 0
  1012. flyer.PitchInput = 0
  1013. flyer.YawInput = 0
  1014. end
  1015.  
  1016. -- Start server-side plane updates:
  1017. function StartUpdating()
  1018. if (updateHandler) then return end
  1019. updateHandler = game:GetService("RunService").Heartbeat:Connect(Update)
  1020. end
  1021.  
  1022. -- Stop server-side plane updates:
  1023. function StopUpdating()
  1024. if (updateHandler) then
  1025. updateHandler:Disconnect()
  1026. updateHandler = nil
  1027. end
  1028. ResetFlyer()
  1029. end
  1030.  
  1031. function PilotExitedEvent(player, t, b, p, y)
  1032. flyer.BankInput = b
  1033. flyer.PitchInput = p
  1034. flyer.YawInput = y
  1035. flyer:ForceRealThrottle(t)
  1036. if (t <= 0.52) then
  1037. flyer.Throttle = 0
  1038. end
  1039. end
  1040.  
  1041. function PilotUpdatedEvent(player, name, ...)
  1042. if (name == "inputs") then
  1043. local inputs = {...}
  1044. flyer.Throttle = inputs[1]
  1045. flyer.BankInput = inputs[2]
  1046. flyer.PitchInput = inputs[3]
  1047. flyer.YawInput = inputs[4]
  1048. end
  1049. end
  1050.  
  1051. -- Handle when a player enters the pilot seat:
  1052. function PilotEntered(player)
  1053. -- Delegate flight controls to the new pilot:
  1054. StopUpdating()
  1055. SetNetworkOwner(player)
  1056. pilot = player
  1057. pilotController = localController:Clone()
  1058. pilotController.Parent = pilot.Backpack
  1059. pilotController:WaitForChild("Plane").Value = plane
  1060. pilotController:WaitForChild("Exited").OnServerEvent:Connect(PilotExitedEvent)
  1061. pilotController:WaitForChild("Updated").OnServerEvent:Connect(PilotUpdatedEvent)
  1062. end
  1063.  
  1064. -- Handle when the pilot leaves the seat:
  1065. function PilotLeft(onPlaneDeath)
  1066. if (not pilot) then return end
  1067. if (not onPlaneDeath) then
  1068. seat.Disabled = true
  1069. end
  1070. -- Tell the client script to stop:
  1071. pilotController.Exit.Value = true
  1072. pilot = nil
  1073. StartUpdating()
  1074. -- Remove network ownership from the player:
  1075. if (not onPlaneDeath) then
  1076. SetNetworkOwner(nil)
  1077. end
  1078. delay(1, function()
  1079. if (pilotController.Parent) then
  1080. pilotController:Destroy()
  1081. end
  1082. pilotController = nil
  1083. if (not seat.Occupant or not dead.Value) then
  1084. seat.Disabled = false
  1085. end
  1086. end)
  1087. end
  1088.  
  1089. -- Track player entering/leaving pilot seat:
  1090. function SeatChanged(property)
  1091. if (property == "Occupant") then
  1092. local humanoid = seat.Occupant
  1093. if (humanoid) then
  1094. local player = game.Players:GetPlayerFromCharacter(humanoid.Parent)
  1095. if (player and not dead.Value) then
  1096. PilotEntered(player)
  1097. end
  1098. else
  1099. PilotLeft()
  1100. end
  1101. end
  1102. end
  1103.  
  1104.  
  1105. dead.Changed:Connect(function(v)
  1106. if (v and pilot) then
  1107. PilotLeft(true)
  1108. end
  1109. end)
  1110.  
  1111.  
  1112. seat.Changed:Connect(SeatChanged)
  1113. seat.Disabled = false
  1114. StartUpdating()
  1115. game:GetService("RunService").Heartbeat:Connect(UpdateControls)
  1116. end))
  1117. LocalScript50.Name = "LocalController"
  1118. LocalScript50.Parent = Script49
  1119. table.insert(cors,sandbox(LocalScript50,function()
  1120. -- Local Controller
  1121. -- Crazyman32
  1122. -- January 18, 2017
  1123.  
  1124. --[[
  1125.  
  1126. This script is given to the pilot of the plane and
  1127. feeds user input to the Flyer module. The Flyer
  1128. module is what is responsible for doing the actual
  1129. heavy work of flying the plane.
  1130.  
  1131. It can dynamically change the type of input used
  1132. to control the plane. The supported controls are
  1133. Keyboard, Mouse+Keyboard, Gamepad, and Mobile.
  1134.  
  1135. --]]
  1136.  
  1137.  
  1138.  
  1139.  
  1140. local IS_CONSOLE = game:GetService("GuiService"):IsTenFootInterface()
  1141. local IS_MOBILE = game:GetService("UserInputService").TouchEnabled and not game:GetService("UserInputService").MouseEnabled and not IS_CONSOLE
  1142. local modal
  1143.  
  1144. local GAMEPAD_DEADZONE = 0.1
  1145.  
  1146. local PI = math.pi
  1147. local ABS = math.abs
  1148.  
  1149. -- Seconds between client sending server input updates:
  1150. local SERVER_UPDATE_INTERVAL = 0.25
  1151.  
  1152. -- Inputs:
  1153. local KEY_W = Enum.KeyCode.W
  1154. local KEY_A = Enum.KeyCode.A
  1155. local KEY_S = Enum.KeyCode.S
  1156. local KEY_D = Enum.KeyCode.D
  1157. local KEY_Q = Enum.KeyCode.Q
  1158. local KEY_E = Enum.KeyCode.E
  1159. local KEY_Z = Enum.KeyCode.Z
  1160. local KEY_X = Enum.KeyCode.X
  1161. local THUMBSTICK_1 = Enum.KeyCode.Thumbstick1
  1162. local THUMBSTICK_2 = Enum.KeyCode.Thumbstick2
  1163. local BUTTON_RB = Enum.KeyCode.ButtonR1
  1164. local BUTTON_RT = Enum.KeyCode.ButtonR2
  1165. local BUTTON_LB = Enum.KeyCode.ButtonL1
  1166. local BUTTON_LT = Enum.KeyCode.ButtonL2
  1167. local MOUSE_BUTTON_2 = Enum.UserInputType.MouseButton2
  1168.  
  1169.  
  1170. local player = game.Players.LocalPlayer
  1171.  
  1172. local plane = script:WaitForChild("Plane")
  1173. while (not plane.Value) do wait() end
  1174. plane = plane.Value
  1175. script.Plane:Destroy()
  1176.  
  1177. local main = plane.PrimaryPart
  1178.  
  1179. local exit = script:WaitForChild("Exit")
  1180. local updated = script:WaitForChild("Updated")
  1181. local flyer = require(plane:WaitForChild("Flyer"))
  1182. local camLock = require(script:WaitForChild("CamLock"))
  1183. local controls = require(script:WaitForChild("Controls"))
  1184. local keyboard = controls.Keyboard
  1185. local mouse = controls.Mouse
  1186. local gamepad = controls.Gamepad
  1187. local mobile = controls.Mobile
  1188.  
  1189. local physicsUpdateHandle
  1190. local renderUpdateName = "PlaneRenderUpdate"
  1191.  
  1192. local lastServerUpdate = 0
  1193. local lastInputUpdate = tick()
  1194.  
  1195. -- Dynamic input function based on user's controls:
  1196. local ReadInput = nil
  1197.  
  1198. -- Keep track of viewport half-size:
  1199. local viewportHalf = game.Workspace.CurrentCamera.ViewportSize * 0.5
  1200. game.Workspace.CurrentCamera.Changed:Connect(function()
  1201. viewportHalf = game.Workspace.CurrentCamera.ViewportSize * 0.5
  1202. end)
  1203.  
  1204.  
  1205. -- Load proper GUI:
  1206. local gui = script:WaitForChild(IS_MOBILE and "PlaneMobileGui" or IS_CONSOLE and "PlaneConsoleGui" or "PlaneGui")
  1207. gui.Parent = player.PlayerGui
  1208. local guiController = require(gui:WaitForChild("GuiController"))
  1209.  
  1210.  
  1211.  
  1212. -- Apply Gamepad Deadzone:
  1213. local function ApplyDeadzone(n)
  1214. if (ABS(n) < GAMEPAD_DEADZONE) then return 0 end
  1215. return (n + (n > 0 and -GAMEPAD_DEADZONE or GAMEPAD_DEADZONE)) / (1 - GAMEPAD_DEADZONE)
  1216. end
  1217.  
  1218.  
  1219. -- Gamepad Input:
  1220. local function ReadGamepadInput(dt)
  1221.  
  1222. -- Get delta time:
  1223. local now = tick()
  1224. local dt = (now - lastInputUpdate)
  1225. lastInputUpdate = now
  1226.  
  1227. -- Get gamepad inputs:
  1228. local thumbstick1 = gamepad:GetPosition(THUMBSTICK_1)
  1229. local thumbstick2 = gamepad:GetPosition(THUMBSTICK_2)
  1230. local lt = ApplyDeadzone(gamepad:GetPosition(BUTTON_LT).Z)
  1231. local rt = ApplyDeadzone(gamepad:GetPosition(BUTTON_RT).Z)
  1232. local lb = gamepad:IsDown(BUTTON_LB)
  1233. local rb = gamepad:IsDown(BUTTON_RB)
  1234.  
  1235. -- Update control inputs:
  1236. flyer.BankInput = ApplyDeadzone(thumbstick2.X)
  1237. flyer.PitchInput = ApplyDeadzone(thumbstick2.Y)
  1238. flyer.YawInput = ((lb ~= rb) and (lb and -1 or 1) or 0)
  1239. do
  1240. local dir = -lt + rt
  1241. local t = flyer.Throttle + (dir * dt * 0.2)
  1242. t = (t < 0.5 and 0.5 or t > 1 and 1 or t)
  1243. flyer.Throttle = t
  1244. guiController:UpdateThrottle(t)
  1245. end
  1246.  
  1247. -- Set camera rotation:
  1248. camLock.SetRotation(
  1249. -ApplyDeadzone(thumbstick1.X) * PI * 0.9,
  1250. ApplyDeadzone(thumbstick1.Y) * PI * 0.45
  1251. )
  1252.  
  1253. end
  1254.  
  1255.  
  1256. -- Mobile Input:
  1257. local function ReadMobileInput()
  1258.  
  1259. -- Poll to see if user wants to switch view:
  1260. if (guiController.SwitchView) then
  1261. guiController.SwitchView = false
  1262. camLock.SwitchView()
  1263. end
  1264.  
  1265. -- Update control inputs:
  1266. flyer.BankInput = guiController.Bank
  1267. flyer.PitchInput = -guiController.Pitch
  1268. flyer.YawInput = guiController.Yaw
  1269. flyer.Throttle = 0.5 + (guiController.Throttle * 0.5)
  1270.  
  1271. -- Set camera rotation:
  1272. camLock.SetMobileDeviceBank(mobile.DeviceBank)
  1273. camLock.SetRotation(
  1274. -guiController.ViewX * PI * 0.9,
  1275. guiController.ViewY * PI * 0.45
  1276. )
  1277.  
  1278. -- Poll to see if player wants to exit the plane:
  1279. if (guiController.Exit) then
  1280. if (player.Character and player.Character:FindFirstChild("Humanoid")) then
  1281. player.Character.Humanoid.Jump = true
  1282. end
  1283. end
  1284.  
  1285. end
  1286.  
  1287.  
  1288. -- Keyboard and Mouse Input:
  1289. local function ReadKeyboardAndMouseInput()
  1290.  
  1291. -- Get delta time:
  1292. local now = tick()
  1293. local dt = (now - lastInputUpdate)
  1294. lastInputUpdate = now
  1295.  
  1296. -- Declare & initialize new control inputs:
  1297. local bank, pitch, yaw, throttle = 0, 0, 0, 0
  1298.  
  1299. -- Mouse yoke:
  1300. if (guiController.UseMouse) then
  1301. -- Mouse and key inputs:
  1302. local mx = mouse.X
  1303. local my = mouse.Y
  1304. local w = keyboard:IsDown(KEY_W)
  1305. local a = keyboard:IsDown(KEY_A)
  1306. local s = keyboard:IsDown(KEY_S)
  1307. local d = keyboard:IsDown(KEY_D)
  1308. if (not mouse:IsDown(MOUSE_BUTTON_2)) then
  1309. -- Update bank and pitch based on mouse position on screen:
  1310. bank = (mx - viewportHalf.X) / viewportHalf.X
  1311. pitch = (my - viewportHalf.Y) / viewportHalf.Y
  1312.  
  1313. --[[ UNCOMMENT this block to lock bank/pitch in last position when looking around:
  1314. else
  1315. bank = flyer.BankInput
  1316. pitch = flyer.PitchInput
  1317. ]]
  1318.  
  1319. end
  1320. -- Update yaw and throttle:
  1321. yaw = ((a ~= d) and (d and 1 or -1) or 0)
  1322. throttle = ((w ~= s) and (w and 1 or -1) or 0)
  1323.  
  1324. -- Keyboard yoke:
  1325. else
  1326. -- This is the prettiest chunk of code in the whole plane system:
  1327.  
  1328. -- Key inputs:
  1329. local w = keyboard:IsDown(KEY_W)
  1330. local a = keyboard:IsDown(KEY_A)
  1331. local s = keyboard:IsDown(KEY_S)
  1332. local d = keyboard:IsDown(KEY_D)
  1333. local q = keyboard:IsDown(KEY_Q)
  1334. local e = keyboard:IsDown(KEY_E)
  1335. local z = keyboard:IsDown(KEY_Z)
  1336. local x = keyboard:IsDown(KEY_X)
  1337.  
  1338. -- Update controls:
  1339. bank = ((a ~= d) and (d and 1 or -1) or 0)
  1340. pitch = ((w ~= s) and (s and 1 or -1) or 0)
  1341. yaw = ((q ~= e) and (e and 1 or -1) or 0)
  1342. throttle = ((z ~= x) and (x and 1 or -1) or 0)
  1343.  
  1344. end
  1345.  
  1346. -- Invert pitch if user requests:
  1347. if (guiController.InvertPitch) then
  1348. pitch = -pitch
  1349. end
  1350.  
  1351. flyer.BankInput = bank
  1352. flyer.PitchInput = pitch
  1353. flyer.YawInput = yaw
  1354.  
  1355. -- Update throttle:
  1356. if (throttle ~= 0) then
  1357. local t = flyer.Throttle + (throttle * dt * 0.2)
  1358. t = (t < 0.5 and 0.5 or t > 1 and 1 or t)
  1359. flyer.Throttle = t
  1360. guiController:UpdateThrottle(t)
  1361. end
  1362.  
  1363. end
  1364.  
  1365.  
  1366. -- Heartbeat:
  1367. function PhysicsUpdate()
  1368.  
  1369. ReadInput()
  1370. flyer:Update()
  1371. guiController:Update()
  1372.  
  1373. -- Update server periodically with control inputs from pilot: (This allows replication of inputs to other clients)
  1374. local now = tick()
  1375. if ((now - lastServerUpdate) > SERVER_UPDATE_INTERVAL) then
  1376. lastServerUpdate = now
  1377. updated:FireServer("inputs", flyer.Throttle, flyer.BankInput, flyer.PitchInput, flyer.YawInput)
  1378. end
  1379.  
  1380. end
  1381.  
  1382.  
  1383. -- RenderStep:
  1384. function RenderUpdate()
  1385. -- Update control animations and camera:
  1386. flyer:UpdateControls()
  1387. camLock.Update()
  1388. end
  1389.  
  1390.  
  1391. -- Keyboard Key Down:
  1392. function KeyDown(keyCode)
  1393. if (gamepad.IsConnected) then return end
  1394. if (keyCode == Enum.KeyCode.C) then
  1395. camLock.SwitchView(keyboard:IsDown(Enum.KeyCode.LeftShift) or keyboard:IsDown(Enum.KeyCode.RightShift))
  1396. end
  1397. end
  1398.  
  1399.  
  1400. -- Gamepad Button Down:
  1401. function GamepadButtonDown(button)
  1402. if (button == Enum.KeyCode.ButtonR3) then
  1403. camLock.SwitchView()
  1404. end
  1405. end
  1406.  
  1407.  
  1408. -- Initialize client-side control of the aircraft:
  1409. function Init()
  1410.  
  1411. camLock.Lock(plane)
  1412. guiController:Start(plane)
  1413. flyer.Throttle = 0.5
  1414.  
  1415. if (IS_MOBILE) then
  1416. -- Hide mobile controls:
  1417. modal = game:GetService("UserInputService").ModalEnabled
  1418. game:GetService("UserInputService").ModalEnabled = true
  1419. else
  1420. -- Listen for gamepad buttons on PC and console:
  1421. gamepad.ButtonDown:Connect(GamepadButtonDown)
  1422. end
  1423.  
  1424. -- Listen for the plane to not exist:
  1425. plane.Changed:Connect(function(property)
  1426. if (property == "Parent" and not plane.Parent) then
  1427. exit.Value = true
  1428. end
  1429. end)
  1430.  
  1431. -- If on PC (not console nor mobile):
  1432. if (not IS_MOBILE and not IS_CONSOLE) then
  1433. guiController:SetUsingGamepad(gamepad.IsConnected)
  1434. gamepad.Connected:Connect(function()
  1435. guiController:SetUsingGamepad(true)
  1436. ReadInput = ReadGamepadInput
  1437. end)
  1438. gamepad.Disconnected:Connect(function()
  1439. guiController:SetUsingGamepad(false)
  1440. ReadInput = ReadKeyboardAndMouseInput
  1441. end)
  1442. keyboard.KeyDown:Connect(KeyDown)
  1443. mouse.Moved:Connect(function(x, y, dx, dy)
  1444. if (guiController.UseMouse and mouse:IsDown(Enum.UserInputType.MouseButton2)) then
  1445. local rotH = -dx * 0.005
  1446. local rotV = -dy * 0.005
  1447. camLock.DeltaRotation(rotH, rotV)
  1448. end
  1449. end)
  1450. mouse.ButtonUp:Connect(function(button)
  1451. if (guiController.UseMouse and button == Enum.UserInputType.MouseButton2) then
  1452. camLock.ResetRotation()
  1453. end
  1454. end)
  1455. end
  1456.  
  1457. -- Input function:
  1458. if (IS_CONSOLE) then
  1459. ReadInput = ReadGamepadInput
  1460. elseif (IS_MOBILE) then
  1461. ReadInput = ReadMobileInput
  1462. else
  1463. ReadInput = (gamepad.IsConnected and ReadGamepadInput or ReadKeyboardAndMouseInput)
  1464. end
  1465.  
  1466. -- Start listeners for RenderUpdate and Heartbeat:
  1467. physicsUpdateHandle = game:GetService("RunService").Heartbeat:Connect(PhysicsUpdate)
  1468. game:GetService("RunService"):BindToRenderStep(renderUpdateName, Enum.RenderPriority.Camera.Value, RenderUpdate)
  1469.  
  1470. flyer:Startup()
  1471.  
  1472. end
  1473.  
  1474.  
  1475. -- Invoked when the player leaves the plane:
  1476. function Stop()
  1477. -- Shut down the flyer; disconnect handlers; reset camera; remove this script:
  1478. camLock.Unlock()
  1479. physicsUpdateHandle:Disconnect()
  1480. game:GetService("RunService"):UnbindFromRenderStep(renderUpdateName)
  1481. script.Exited:FireServer(flyer.Throttle, flyer.BankInput, flyer.PitchInput, flyer.YawInput)
  1482. if (gui) then
  1483. gui:Destroy()
  1484. end
  1485. if (IS_MOBILE) then
  1486. game:GetService("UserInputService").ModalEnabled = modal
  1487. end
  1488. guiController:Stop()
  1489. flyer:Shutdown()
  1490. wait(0.1) -- Arbitrary yield; probably not needed
  1491. script:Destroy()
  1492. end
  1493.  
  1494.  
  1495. -- The server-side Controller will switch 'exit' to 'true' when it
  1496. -- is time for this script to remove itself (typically when the
  1497. -- player leaves the pilot seat).
  1498. exit.Changed:Connect(function(v)
  1499. if (v) then
  1500. Stop()
  1501. end
  1502. end)
  1503.  
  1504. Init()
  1505. end))
  1506. ObjectValue51.Name = "Plane"
  1507. ObjectValue51.Parent = LocalScript50
  1508. BoolValue52.Name = "Exit"
  1509. BoolValue52.Parent = LocalScript50
  1510. ModuleScript53.Name = "Controls"
  1511. ModuleScript53.Parent = LocalScript50
  1512. table.insert(cors,sandbox(ModuleScript53,function()
  1513. -- Controls
  1514. -- Crazyman32
  1515. -- October 9, 2015
  1516.  
  1517. -- Updated January 19, 2017 for use in plane system
  1518.  
  1519. --[[
  1520.  
  1521. Controls.Keyboard
  1522. Controls.Mouse
  1523. Controls.Gamepad
  1524.  
  1525. --]]
  1526.  
  1527.  
  1528.  
  1529. local Controls = {
  1530. Keyboard = require(script:WaitForChild("Keyboard"));
  1531. Mouse = require(script:WaitForChild("Mouse"));
  1532. Gamepad = require(script:WaitForChild("Gamepad"));
  1533. Mobile = require(script:WaitForChild("Mobile"));
  1534. }
  1535.  
  1536. return Controls
  1537. end))
  1538. ModuleScript54.Name = "Mouse"
  1539. ModuleScript54.Parent = ModuleScript53
  1540. table.insert(cors,sandbox(ModuleScript54,function()
  1541. -- Mouse
  1542. -- Crazyman32
  1543. -- October 9, 2015
  1544.  
  1545. -- Modified January 31, 2016
  1546. -- Added SetIcon and SetVisible methods
  1547.  
  1548. -- Modified January 28, 2017
  1549. -- Added DeltaX and DeltaY parameters to the Moved event
  1550.  
  1551. --[[
  1552.  
  1553. local mouse = require(this)
  1554.  
  1555. FIELDS:
  1556.  
  1557. (X, Y, Ignore)
  1558.  
  1559. Int mouse.X
  1560. Int mouse.Y
  1561. Table mouse.Ignore
  1562.  
  1563.  
  1564. METHODS:
  1565.  
  1566. (IsDown, Project, ProjectFromCharacter, Ray, SetIcon, SetVisible)
  1567.  
  1568. Boolean isDown: mouse:IsDown(UserInputType button)
  1569. CFrame hit, Part target, Vector3 normal: mouse:Project([Number maxDistance = 999, Table ignoreListOverride])
  1570. CFrame hit, Part target, Vector3 normal: mouse:ProjectFromCharacter([Number maxDistance = 999, Table ignoreListOverride])
  1571. Ray mouseRay: mouse:Ray()
  1572. void: mouse:SetIcon(String imageIcon)
  1573. void: mouse:SetVisible(Boolean isVisible)
  1574.  
  1575.  
  1576. EVENTS:
  1577.  
  1578. (ButtonDown, ButtonUp, Moved, Scrolled)
  1579.  
  1580. mouse.ButtonDown(UserInputType button, Vector3 position)
  1581. mouse.ButtonUp(UserInputType button, Vector3 position)
  1582. mouse.Moved(Int x, Int y, Int deltaX, Int deltaY)
  1583. mouse.Scrolled(Int direction)
  1584.  
  1585. --]]
  1586.  
  1587.  
  1588. assert(game:GetService("RunService"):IsClient(), "Mouse can only be used from client")
  1589.  
  1590. local Mouse = {
  1591. X = 0;
  1592. Y = 0;
  1593. Ignore = {};
  1594. }
  1595.  
  1596. local player = game.Players.LocalPlayer
  1597. local iconGui = Instance.new("ScreenGui")
  1598. iconGui.Name = "IconGui"
  1599. local iconImg = Instance.new("ImageLabel", iconGui)
  1600. iconImg.Name = "Icon"
  1601. iconImg.BackgroundTransparency = 1
  1602.  
  1603. local userInput = game:GetService("UserInputService")
  1604.  
  1605. local maxRayDistance = 999
  1606.  
  1607. -- Mouse button references:
  1608. local mButton1 = Enum.UserInputType.MouseButton1
  1609. local mButton2 = Enum.UserInputType.MouseButton2
  1610. local mButton3 = Enum.UserInputType.MouseButton3
  1611. local mWheel = Enum.UserInputType.MouseWheel
  1612. local mMovement = Enum.UserInputType.MouseMovement
  1613.  
  1614. local buttonDown = {
  1615. [mButton1] = false;
  1616. [mButton2] = false;
  1617. [mButton3] = false;
  1618. }
  1619.  
  1620. -- Create events:
  1621. local onButtonDown = Instance.new("BindableEvent")
  1622. local onButtonUp = Instance.new("BindableEvent")
  1623. local onMoved = Instance.new("BindableEvent")
  1624. local onScrolled = Instance.new("BindableEvent")
  1625.  
  1626. -- Expose events:
  1627. Mouse.ButtonDown = onButtonDown.Event
  1628. Mouse.ButtonUp = onButtonUp.Event
  1629. Mouse.Moved = onMoved.Event
  1630. Mouse.Scrolled = onScrolled.Event
  1631.  
  1632.  
  1633. -- Projections:
  1634. do
  1635.  
  1636. local workspace = game.Workspace
  1637. local findPartOnRayWithIgnoreList = workspace.FindPartOnRayWithIgnoreList
  1638. local cam = game.Workspace.CurrentCamera
  1639. local Ray = Ray.new
  1640. local screenPointToRay = cam.ScreenPointToRay
  1641. local CF = CFrame.new
  1642.  
  1643. function Mouse:Ray()
  1644. return screenPointToRay(cam, self.X, self.Y, 0)
  1645. end
  1646.  
  1647. function Mouse:Project(maxDistance, ignore)
  1648. local ray = screenPointToRay(cam, self.X, self.Y, 0)
  1649. ray = Ray(ray.Origin, (ray.Unit.Direction * (maxDistance or maxRayDistance)))
  1650. local hit, hitPos, normal = findPartOnRayWithIgnoreList(workspace, ray, ignore or self.Ignore or {}, true, false)
  1651. local cframe = CF(hitPos, (hitPos + ray.Unit.Direction))
  1652. return cframe, hit, normal
  1653. end
  1654.  
  1655. function Mouse:ProjectFromCharacter(maxDistance, ignore)
  1656. if (player.Character) then
  1657. local head = player.Character:FindFirstChild("Head")
  1658. if (head) then
  1659. maxDistance = (maxDistance or maxRayDistance)
  1660. local cframe, hit, normal = self:Project(nil, ignore)
  1661. cframe = CF(cframe.p, cframe.p + CF(head.Position, cframe.p).lookVector)
  1662. local dist = (head.Position - cframe.p).Magnitude
  1663. if (dist > maxDistance) then
  1664. cframe = CF(head.Position + (cframe.lookVector * maxDistance), head.Position + (cframe.lookVector * maxDistance * 2))
  1665. end
  1666. return cframe, hit, normal
  1667. end
  1668. end
  1669. end
  1670.  
  1671. function Mouse:GetTarget()
  1672. local cframe, hit, normal = self:Project()
  1673. return hit
  1674. end
  1675.  
  1676. function Mouse:GetHitCFrame()
  1677. local cframe, hit, normal = self:Project()
  1678. return cframe
  1679. end
  1680.  
  1681. end
  1682.  
  1683.  
  1684. function Mouse:IsDown(button)
  1685. return buttonDown[button]
  1686. end
  1687.  
  1688.  
  1689. function Mouse:SetIcon(assetId)
  1690. player:GetMouse().Icon = assetId
  1691. end
  1692.  
  1693.  
  1694. function Mouse:SetVisible(isVisible)
  1695. userInput.MouseIconEnabled = isVisible
  1696. end
  1697.  
  1698.  
  1699. local function InputBegan(input, processed)
  1700. if (processed) then return end
  1701. local iType = input.UserInputType
  1702. if (iType == mButton1 or iType == mButton2 or iType == mButton3) then
  1703. buttonDown[iType] = true
  1704. onButtonDown:Fire(iType, input.Position)
  1705. end
  1706. end
  1707.  
  1708. local function InputEnded(input, processed)
  1709. if (processed) then return end
  1710. local iType = input.UserInputType
  1711. if (iType == mButton1 or iType == mButton2 or iType == mButton3) then
  1712. buttonDown[iType] = false
  1713. onButtonUp:Fire(iType, input.Position)
  1714. end
  1715. end
  1716.  
  1717. local function InputChanged(input, processed)
  1718. if (processed) then return end
  1719. local iType = input.UserInputType
  1720. if (iType == mMovement) then
  1721. local x, y = input.Position.X, input.Position.Y
  1722. local dx, dy = (x - Mouse.X), (y - Mouse.Y)
  1723. Mouse.X = x
  1724. Mouse.Y = y
  1725. onMoved:Fire(x, y, dx, dy)
  1726. elseif (iType == mWheel) then
  1727. onScrolled:Fire(input.Position.Z)
  1728. end
  1729. end
  1730.  
  1731.  
  1732. userInput.InputBegan:Connect(InputBegan)
  1733. userInput.InputEnded:Connect(InputEnded)
  1734. userInput.InputChanged:Connect(InputChanged)
  1735.  
  1736.  
  1737. return Mouse
  1738. end))
  1739. ModuleScript55.Name = "Keyboard"
  1740. ModuleScript55.Parent = ModuleScript53
  1741. table.insert(cors,sandbox(ModuleScript55,function()
  1742. -- Keyboard
  1743. -- Crazyman32
  1744. -- October 9, 2015
  1745.  
  1746. --[[
  1747.  
  1748. local keyboard = require(this)
  1749.  
  1750. METHODS:
  1751.  
  1752. (IsDown)
  1753.  
  1754. Boolean isDown: keyboard:IsDown(KeyCode key)
  1755.  
  1756.  
  1757. EVENTS:
  1758.  
  1759. (KeyDown, KeyUp)
  1760.  
  1761. keyboard.KeyDown(KeyCode key)
  1762. keyboard.KeyUp(KeyCode key)
  1763.  
  1764. --]]
  1765.  
  1766.  
  1767. assert(game:GetService("RunService"):IsClient(), "Keyboard can only be used from client")
  1768.  
  1769.  
  1770. local Keyboard = {}
  1771.  
  1772. local userInput = game:GetService("UserInputService")
  1773.  
  1774. local isDown = {}
  1775.  
  1776. local keyboardInput = Enum.UserInputType.Keyboard
  1777.  
  1778. local onKeyDown = Instance.new("BindableEvent")
  1779. local onKeyUp = Instance.new("BindableEvent")
  1780.  
  1781. Keyboard.KeyDown = onKeyDown.Event
  1782. Keyboard.KeyUp = onKeyUp.Event
  1783.  
  1784.  
  1785. function Keyboard:IsDown(keyCode)
  1786. return (isDown[keyCode] == true)
  1787. end
  1788.  
  1789.  
  1790. local function InputBegan(input, processed)
  1791. if (processed) then return end
  1792. if (input.UserInputType == keyboardInput) then
  1793. local key = input.KeyCode
  1794. isDown[key] = true
  1795. onKeyDown:Fire(key)
  1796. end
  1797. end
  1798.  
  1799. local function InputEnded(input, processed)
  1800. if (processed) then return end
  1801. if (input.UserInputType == keyboardInput) then
  1802. local key = input.KeyCode
  1803. isDown[key] = false
  1804. onKeyUp:Fire(key)
  1805. end
  1806. end
  1807.  
  1808.  
  1809. userInput.InputBegan:Connect(InputBegan)
  1810. userInput.InputEnded:Connect(InputEnded)
  1811.  
  1812.  
  1813. return Keyboard
  1814. end))
  1815. ModuleScript56.Name = "Gamepad"
  1816. ModuleScript56.Parent = ModuleScript53
  1817. table.insert(cors,sandbox(ModuleScript56,function()
  1818. -- Gamepad
  1819. -- Crazyman32
  1820. -- January 19, 2017
  1821.  
  1822. -- NOTE: Specifically listens for Gamepad1 controls only!!!
  1823.  
  1824. --[[
  1825.  
  1826. FIELDS:
  1827.  
  1828. Gamepad.IsConnected > true|false
  1829.  
  1830.  
  1831. METHODS:
  1832.  
  1833. Gamepad:IsDown(keyCode) > true|false
  1834. Gamepad:GetInput(keyCode) > returns InputObject associated with keycode (nil if none)
  1835. Gamepad:GetPosition(keyCode) > Vector3 (will return 0,0,0 if no keycode available)
  1836.  
  1837.  
  1838. EVENTS:
  1839.  
  1840. Gamepad.ButtonDown(keyCode)
  1841. Gamepad.ButtonUp(keyCode)
  1842. Gamepad.Changed(keyCode)
  1843. Gamepad.Connected()
  1844. Gamepad.Disconnected()
  1845.  
  1846. --]]
  1847.  
  1848.  
  1849. local GAMEPAD1 = Enum.UserInputType.Gamepad1
  1850. local ZERO_VECTOR = Vector3.new()
  1851.  
  1852. local buttonDown = Instance.new("BindableEvent")
  1853. local buttonUp = Instance.new("BindableEvent")
  1854. local changed = Instance.new("BindableEvent")
  1855. local connected = Instance.new("BindableEvent")
  1856. local disconnected = Instance.new("BindableEvent")
  1857.  
  1858. local down = {}
  1859. local state = {}
  1860.  
  1861.  
  1862.  
  1863. local Gamepad = {
  1864. IsConnected = game:GetService("UserInputService"):GetGamepadConnected(GAMEPAD1);
  1865. ButtonDown = buttonDown.Event;
  1866. ButtonUp = buttonUp.Event;
  1867. Changed = changed.Event;
  1868. Connected = connected.Event;
  1869. Disconnected = disconnected.Event;
  1870. }
  1871.  
  1872. function Gamepad:IsDown(keyCode)
  1873. return (down[keyCode] == true)
  1874. end
  1875.  
  1876. function Gamepad:GetInput(keyCode)
  1877. return state[keyCode]
  1878. end
  1879.  
  1880. function Gamepad:GetPosition(keyCode)
  1881. local input = self:GetInput(keyCode)
  1882. if (input) then
  1883. return input.Position
  1884. end
  1885. return ZERO_VECTOR
  1886. end
  1887.  
  1888.  
  1889.  
  1890. function Reset()
  1891. down = {}
  1892. state = {}
  1893. end
  1894.  
  1895.  
  1896. function GetState()
  1897. -- Map KeyCodes to corresponding InputObjects on the gamepad:
  1898. local s = game:GetService("UserInputService"):GetGamepadState(GAMEPAD1)
  1899. for _,inputObj in pairs(s) do
  1900. state[inputObj.KeyCode] = inputObj
  1901. end
  1902. end
  1903.  
  1904.  
  1905. function InputBegan(input, processed)
  1906. if (input.UserInputType == GAMEPAD1) then
  1907. down[input.KeyCode] = true
  1908. buttonDown:Fire(input.KeyCode)
  1909. end
  1910. end
  1911.  
  1912.  
  1913. function InputEnded(input, processed)
  1914. if (input.UserInputType == GAMEPAD1) then
  1915. down[input.KeyCode] = false
  1916. buttonUp:Fire(input.KeyCode)
  1917. end
  1918. end
  1919.  
  1920.  
  1921. function InputChanged(input, processed)
  1922. if (input.UserInputType == GAMEPAD1) then
  1923. changed:Fire(input.KeyCode)
  1924. end
  1925. end
  1926.  
  1927.  
  1928. function GamepadConnected(gamepad)
  1929. if (gamepad == GAMEPAD1) then
  1930. Gamepad.IsConnected = true
  1931. GetState()
  1932. connected:Fire()
  1933. end
  1934. end
  1935.  
  1936.  
  1937. function GamepadDisconnected(gamepad)
  1938. if (gamepad == GAMEPAD1) then
  1939. Gamepad.IsConnected = false
  1940. Reset()
  1941. disconnected:Fire()
  1942. end
  1943. end
  1944.  
  1945.  
  1946. game:GetService("UserInputService").InputBegan:Connect(InputBegan)
  1947. game:GetService("UserInputService").InputEnded:Connect(InputEnded)
  1948. game:GetService("UserInputService").InputChanged:Connect(InputChanged)
  1949. game:GetService("UserInputService").GamepadConnected:Connect(GamepadConnected)
  1950. game:GetService("UserInputService").GamepadDisconnected:Connect(GamepadDisconnected)
  1951.  
  1952.  
  1953. if (Gamepad.IsConnected) then
  1954. GetState()
  1955. end
  1956.  
  1957.  
  1958. return Gamepad
  1959. end))
  1960. ModuleScript57.Name = "Mobile"
  1961. ModuleScript57.Parent = ModuleScript53
  1962. table.insert(cors,sandbox(ModuleScript57,function()
  1963. -- Mobile
  1964. -- Crazyman32
  1965. -- January 26, 2017
  1966.  
  1967.  
  1968.  
  1969. local Mobile = {
  1970. Pitch = 0;
  1971. Bank = 0;
  1972. Yaw = 0;
  1973. SwitchView = false;
  1974.  
  1975. DeviceBank = 0;
  1976. DevicePitch = 0;
  1977.  
  1978. }
  1979.  
  1980. local PI_HALF = math.pi * 0.5
  1981. local ATAN2 = math.atan2
  1982.  
  1983. local MAX_DEVICE_ROTATION = math.rad(60)
  1984.  
  1985. local userInput = game:GetService("UserInputService")
  1986. local initialGravity = Vector3.new()
  1987.  
  1988. local accelEnabled = userInput.AccelerometerEnabled
  1989.  
  1990. function ClampAndNormalize(n, lowHigh)
  1991. return (n < -lowHigh and -lowHigh or n > lowHigh and lowHigh or n) / lowHigh
  1992. end
  1993.  
  1994.  
  1995. function DeviceGravityChanged(gravity)
  1996.  
  1997. gravity = (gravity.Position + initialGravity)
  1998.  
  1999. -- Thanks to Fractality_alt for the below algorithm:
  2000. local gravX, gravY, gravZ = gravity.X, gravity.Y, gravity.Z
  2001. local bank = (gravX > 0 and PI_HALF or -PI_HALF) - ATAN2(gravX, gravZ)
  2002. local pitch = ATAN2(gravY, (gravX * gravX + gravZ * gravZ) ^ 0.5)
  2003.  
  2004. Mobile.Bank = -ClampAndNormalize(bank, MAX_DEVICE_ROTATION)
  2005. Mobile.Pitch = -ClampAndNormalize(pitch, MAX_DEVICE_ROTATION)
  2006.  
  2007. Mobile.DeviceBank = bank
  2008. Mobile.DevicePitch = pitch
  2009.  
  2010. end
  2011.  
  2012.  
  2013. if (accelEnabled) then
  2014. initialGravity = userInput:GetDeviceGravity().Position
  2015. userInput.DeviceGravityChanged:Connect(DeviceGravityChanged)
  2016. end
  2017.  
  2018. --[[
  2019. userInput.TouchLongPress:Connect(function(touchPositions, state, processed)
  2020. if (processed or state ~= Enum.UserInputState.Begin) then return end
  2021. Mobile.SwitchView = true
  2022. end)
  2023. ]]
  2024.  
  2025.  
  2026. return Mobile
  2027. end))
  2028. RemoteEvent58.Name = "Exited"
  2029. RemoteEvent58.Parent = LocalScript50
  2030. RemoteEvent59.Name = "Updated"
  2031. RemoteEvent59.Parent = LocalScript50
  2032. ModuleScript60.Name = "CamLock"
  2033. ModuleScript60.Parent = LocalScript50
  2034. table.insert(cors,sandbox(ModuleScript60,function()
  2035. -- Cam Lock
  2036. -- Crazyman32
  2037. -- January 23, 2017
  2038.  
  2039. --[[
  2040.  
  2041. Specialized library for the plane's camera.
  2042.  
  2043. Note my inconsistency by using "." accessors
  2044. for methods instead of ":" accessors. Sorry.
  2045.  
  2046.  
  2047. CamLock.Update() [Should be called every RenderStep]
  2048.  
  2049. CamLock.Lock(planeModel)
  2050. CamLock.Unlock()
  2051. CamLock.SwitchView([reversed])
  2052. CamLock.SetMobileDeviceBank(bank)
  2053. CamLock.SetRotation(horizontalRadians, verticalRadians)
  2054. CamLock.DeltaRotation(deltaHorizontalRadians, deltaVerticalRadians)
  2055. CamLock.ResetRotation()
  2056.  
  2057. --]]
  2058.  
  2059.  
  2060. -- Time it takes to tween between view switches:
  2061. local TWEEN_DURATION = 0.25
  2062.  
  2063.  
  2064. local V3 = Vector3.new
  2065. local CF = CFrame.new
  2066. local ANG = CFrame.Angles
  2067. local ACOS = math.acos
  2068. local COS = math.cos
  2069. local SIN = math.sin
  2070. local RAND = math.random
  2071. local TAU = math.pi * 2
  2072.  
  2073.  
  2074. local CamLock = {}
  2075.  
  2076. local cam = game.Workspace.CurrentCamera
  2077. local plane
  2078. local seat
  2079.  
  2080. local currentViewIndex = 1
  2081. local currentView
  2082.  
  2083. local viewRotH = 0
  2084. local viewRotV = 0
  2085. local MAX_VIEW_ROT_V = math.rad(80)
  2086.  
  2087. local mobileDeviceBank = 0
  2088.  
  2089. local Damping = require(script:WaitForChild("Damping"))
  2090. local easing = require(script:WaitForChild("Easing"))
  2091.  
  2092. local dampCam = Damping.new()
  2093. local dampRot = Damping.new()
  2094. local dampShake = Damping.new()
  2095. dampShake.P = 3
  2096. dampShake.D = 0.05
  2097.  
  2098.  
  2099. local tweening = false
  2100. local tweenStart = 0
  2101. local tweenFromView = nil
  2102.  
  2103.  
  2104.  
  2105. local views = {
  2106.  
  2107. -- Pivot: Point around which camera rotates
  2108. -- Offset: Camera offset from pivot point
  2109. -- Ease: Ease function used when tweening into the view
  2110.  
  2111. -- Third-person:
  2112. {
  2113. Pivot = CF(0, 3.5, -1.1);
  2114. Offset = CF(0, 8, 40);
  2115. Ease = easing.outQuint;
  2116. };
  2117.  
  2118. -- First-person:
  2119. {
  2120. Pivot = CF(0, 3.5, -1.1);
  2121. Offset = CF(0, 0, 0);
  2122. Ease = easing.outQuint;
  2123. };
  2124.  
  2125. -- Landing gear:
  2126. {
  2127. Pivot = CF(0, -3.5, -0.5);
  2128. Offset = CF(0, 0, 0);
  2129. Ease = easing.outQuint;
  2130. };
  2131.  
  2132. }
  2133.  
  2134.  
  2135. -- Clamp a vector to a max given magnitude:
  2136. local function ClampMagnitude(vector, mag)
  2137. return (vector.Magnitude > mag and (vector.Unit * mag) or vector)
  2138. end
  2139.  
  2140.  
  2141. -- Clamp a number between low and high:
  2142. local function Clamp(n, low, high)
  2143. return (n < low and low or n > high and high or n)
  2144. end
  2145.  
  2146.  
  2147. -- Get the angle between two vectors:
  2148. local function Angle(from, to)
  2149. return ACOS(Clamp(from.Unit:Dot(to.Unit), -1, 1))
  2150. end
  2151.  
  2152.  
  2153. -- Set rotation of camera around pivot point:
  2154. local function SetRotation(h, v)
  2155. viewRotH = h
  2156. viewRotV = Clamp(v, -MAX_VIEW_ROT_V, MAX_VIEW_ROT_V)
  2157. dampRot.Goal = V3(viewRotH, viewRotV, 0)
  2158. end
  2159.  
  2160.  
  2161. -- Simulate camera shake (not great, but works well enough for this):
  2162. local function GetCameraShake()
  2163. local dragAngle = Angle(seat.CFrame.lookVector, seat.Velocity)
  2164. local speed = seat.Velocity.Magnitude
  2165.  
  2166. local shakeMagnitude = (speed * 0.02) * dragAngle * 0.1
  2167.  
  2168. local theta = RAND() * TAU
  2169. local x = COS(theta) * shakeMagnitude
  2170. local y = SIN(theta) * shakeMagnitude
  2171. -- ^
  2172. -- THE STARS ALIGN ^ DUN DUN DUN
  2173. -- ^
  2174.  
  2175. return V3(x, y, 0)
  2176. end
  2177.  
  2178.  
  2179. local function GetCameraRotation()
  2180.  
  2181. -- Relative rotational velocity:
  2182. dampCam.Goal = -seat.CFrame:vectorToObjectSpace(seat.RotVelocity) * 0.1
  2183. local relRotVel = dampCam:Update()
  2184.  
  2185. -- Camera shake offset:
  2186. dampShake.Goal = GetCameraShake()
  2187. local shake = CF(dampShake:Update())
  2188.  
  2189. -- User view rotation:
  2190. local viewRotation = dampRot:Update()
  2191. viewRotation = ANG(0, viewRotation.X, 0) * ANG(viewRotation.Y, 0, 0)
  2192.  
  2193. return ANG(0, 0, mobileDeviceBank) * viewRotation * ANG(relRotVel.X, relRotVel.Y, relRotVel.Z) * shake
  2194.  
  2195. end
  2196.  
  2197.  
  2198. -- Get the CFrame of the given view with proper view rotations (before any tweening is done):
  2199. local function GetViewCFrame(view, rotation)
  2200. return seat.CFrame * view.Pivot * rotation * view.Offset
  2201. end
  2202.  
  2203.  
  2204. -- Update the camera without tweening:
  2205. local function Update()
  2206. local camRotation = GetCameraRotation()
  2207. cam.CFrame = GetViewCFrame(currentView, camRotation)
  2208. end
  2209.  
  2210.  
  2211. -- Update the camera with tweening: (Used instead of Update function when animating between views)
  2212. local function UpdateWithTween()
  2213. local duration = (tick() - tweenStart)
  2214. if (duration >= TWEEN_DURATION) then
  2215. duration = TWEEN_DURATION
  2216. CamLock.Update = Update
  2217. tweening = false
  2218. end
  2219.  
  2220. local camRotation = GetCameraRotation()
  2221. local tweenAmount = currentView.Ease(duration, 0, 1, TWEEN_DURATION)
  2222. local cf0 = GetViewCFrame(tweenFromView, camRotation)
  2223. local cf1 = GetViewCFrame(currentView, camRotation)
  2224. cam.CFrame = cf0:lerp(cf1, tweenAmount)
  2225.  
  2226. -- If you like unreadable code, here's the above chunk (from camRotation) in one step:
  2227. --cam.CFrame = GetViewCFrame(tweenFromView, GetCameraRotation()):lerp(GetViewCFrame(currentView, GetCameraRotation()), currentView.Ease(duration, 0, 1, TWEEN_DURATION))
  2228.  
  2229. end
  2230.  
  2231.  
  2232. -- Default to Update for the CamLock.Update function.
  2233. -- This is dynamically switched to UpdateWithTweeen when animating between views.
  2234. CamLock.Update = Update
  2235.  
  2236.  
  2237. -- Switch to the next (or previous) view:
  2238. function CamLock.SwitchView(reverse)
  2239. if (tweening) then return end
  2240. tweenFromView = currentView
  2241. currentViewIndex = (currentViewIndex + (reverse and -1 or 1))
  2242. currentViewIndex = (currentViewIndex < 1 and #views or currentViewIndex > #views and 1 or currentViewIndex)
  2243. currentView = views[currentViewIndex]
  2244. if (tweenFromView ~= currentView) then
  2245. tweening = true
  2246. tweenStart = tick()
  2247. CamLock.Update = UpdateWithTween
  2248. end
  2249. end
  2250.  
  2251.  
  2252. -- Set the rotation:
  2253. function CamLock.SetRotation(horizontal, vertical)
  2254. SetRotation(horizontal, vertical)
  2255. end
  2256.  
  2257.  
  2258. -- Change the rotation:
  2259. function CamLock.DeltaRotation(horizontal, vertical)
  2260. SetRotation(viewRotH + horizontal, viewRotV + vertical)
  2261. end
  2262.  
  2263.  
  2264. -- Reset the rotation:
  2265. function CamLock.ResetRotation()
  2266. SetRotation(0, 0)
  2267. end
  2268.  
  2269.  
  2270. -- Set camera tilt correction for mobile:
  2271. function CamLock.SetMobileDeviceBank(bank)
  2272. mobileDeviceBank = bank
  2273. end
  2274.  
  2275.  
  2276. -- Lock the view:
  2277. function CamLock.Lock(p)
  2278. cam.CameraType = Enum.CameraType.Scriptable
  2279. plane = p
  2280. seat = plane:WaitForChild("Functional"):WaitForChild("PilotSeat")
  2281. currentView = views[currentViewIndex]
  2282. end
  2283.  
  2284.  
  2285. -- Unlock the camera:
  2286. function CamLock.Unlock()
  2287. cam.CameraType = Enum.CameraType.Custom
  2288. plane = nil
  2289. end
  2290.  
  2291.  
  2292. return CamLock
  2293. end))
  2294. ModuleScript61.Name = "Easing"
  2295. ModuleScript61.Parent = ModuleScript60
  2296. table.insert(cors,sandbox(ModuleScript61,function()
  2297. -- https://github.com/EmmanuelOga/easing
  2298. local F=math.pow local r=math.sin local h=math.cos local s=math.pi local o=math.sqrt local b=math.abs local p=math.asin local function m(c,b,a,d)return a*c/d+b end local function E(d,b,a,c)d=d/c return a*F(d,2)+b end local function y(d,c,a,b)d=d/b return-a*d*(d-2)+c end local function k(d,b,c,a)d=d/a*2 if d<1 then return c/2*F(d,2)+b else return-c/2*((d-1)*(d-3)-1)+b end end local function l(c,a,b,d)if c<d/2 then return y(c*2,a,b/2,d)else return E((c*2)-d,a+b/2,b/2,d)end end local function z(d,a,b,c)d=d/c return b*F(d,3)+a end local function B(d,b,a,c)d=d/c-1 return a*(F(d,3)+1)+b end local function j(d,b,c,a)d=d/a*2 if d<1 then return c/2*d*d*d+b else d=d-2 return c/2*(d*d*d+2)+b end end local function e(c,a,b,d)if c<d/2 then return B(c*2,a,b/2,d)else return z((c*2)-d,a+b/2,b/2,d)end end local function A(d,a,c,b)d=d/b return c*F(d,4)+a end local function H(d,c,b,a)d=d/a-1 return-b*(F(d,4)-1)+c end local function d(d,c,b,a)d=d/a*2 if d<1 then return b/2*F(d,4)+c else d=d-2 return-b/2*(F(d,4)-2)+c end end local function c(c,a,b,d)if c<d/2 then return H(c*2,a,b/2,d)else return A((c*2)-d,a+b/2,b/2,d)end end local function D(d,b,a,c)d=d/c return a*F(d,5)+b end local function C(d,c,b,a)d=d/a-1 return b*(F(d,5)+1)+c end local function f(d,b,c,a)d=d/a*2 if d<1 then return c/2*F(d,5)+b else d=d-2 return c/2*(F(d,5)+2)+b end end local function g(c,a,b,d)if c<d/2 then return C(c*2,a,b/2,d)else return D((c*2)-d,a+b/2,b/2,d)end end local function w(a,b,d,c)return-d*h(a/c*(s/2))+d+b end local function L(c,d,a,b)return a*r(c/b*(s/2))+d end local function i(d,c,a,b)return-a/2*(h(s*d/b)-1)+c end local function h(b,a,c,d)if b<d/2 then return L(b*2,a,c/2,d)else return w((b*2)-d,a+c/2,c/2,d)end end local function I(b,c,d,a)if b==0 then return c else return d*F(2,10*(b/a-1))+c-d*0.001 end end local function K(b,a,c,d)if b==d then return a+c else return c*1.001*(-F(2,-10*b/d)+1)+a end end local function t(d,c,b,a)if d==0 then return c end if d==a then return c+b end d=d/a*2 if d<1 then return b/2*F(2,10*(d-1))+c-b*0.0005 else d=d-1 return b/2*1.0005*(-F(2,-10*d)+2)+c end end local function n(b,a,c,d)if b<d/2 then return K(b*2,a,c/2,d)else return I((b*2)-d,a+c/2,c/2,d)end end local function v(d,c,a,b)d=d/b return(-a*(o(1-F(d,2))-1)+c)end local function x(d,c,b,a)d=d/a-1 return(b*o(1-F(d,2))+c)end local function u(d,b,c,a)d=d/a*2 if d<1 then return-c/2*(o(1-d*d)-1)+b else d=d-2 return c/2*(o(1-d*d)+1)+b end end local function o(c,a,b,d)if c<d/2 then return x(c*2,a,b/2,d)else return v((c*2)-d,a+b/2,b/2,d)end end local function G(h,a,e,c,f,g)if h==0 then return a end h=h/c if h==1 then return a+e end if not g then g=c*0.3 end local d if not f or f<b(e)then f=e d=g/4 else d=g/(2*s)*p(e/f)end h=h-1 return-(f*F(2,10*h)*r((h*c-d)*(2*s)/g))+a end local function M(h,d,f,c,g,e)if h==0 then return d end h=h/c if h==1 then return d+f end if not e then e=c*0.3 end local a if not g or g<b(f)then g=f a=e/4 else a=e/(2*s)*p(f/g)end return g*F(2,-10*h)*r((h*c-a)*(2*s)/e)+f+d end local function q(h,d,e,c,g,f)if h==0 then return d end h=h/c*2 if h==2 then return d+e end if not f then f=c*(0.3*1.5)end if not g then g=0 end local a if not g or g<b(e)then g=e a=f/4 else a=f/(2*s)*p(e/g)end if h<1 then h=h-1 return-0.5*(g*F(2,10*h)*r((h*c-a)*(2*s)/f))+d else h=h-1 return g*F(2,-10*h)*r((h*c-a)*(2*s)/f)*0.5+e+d end end local function p(e,c,d,f,a,b)if e<f/2 then return M(e*2,c,d/2,f,a,b)else return G((e*2)-f,c+d/2,d/2,f,a,b)end end local function J(e,c,b,a,d)if not d then d=1.70158 end e=e/a return b*e*e*((d+1)*e-d)+c end local function F(e,a,b,c,d)if not d then d=1.70158 end e=e/c-1 return b*(e*e*((d+1)*e+d)+1)+a end local function r(e,c,b,a,d)if not d then d=1.70158 end d=d*1.525 e=e/a*2 if e<1 then return b/2*(e*e*((d+1)*e-d))+c else e=e-2 return b/2*(e*e*((d+1)*e+d)+2)+c end end local function s(c,a,d,e,b)if c<e/2 then return F(c*2,a,d/2,e,b)else return J((c*2)-e,a+d/2,d/2,e,b)end end local function O(d,b,c,a)d=d/a if d<1/2.75 then return c*(7.5625*d*d)+b elseif d<2/2.75 then d=d-(1.5/2.75)return c*(7.5625*d*d+0.75)+b elseif d<2.5/2.75 then d=d-(2.25/2.75)return c*(7.5625*d*d+0.9375)+b else d=d-(2.625/2.75)return c*(7.5625*d*d+0.984375)+b end end local function N(a,b,d,c)return d-O(c-a,0,d,c)+b end local function b(c,a,b,d)if c<d/2 then return N(c*2,0,b,d)*0.5+a else return O(c*2-d,0,b,d)*0.5+b*.5+a end end local function a(b,a,c,d)if b<d/2 then return O(b*2,a,c/2,d)else return N((b*2)-d,a+c/2,c/2,d)end end return{linear=m,inQuad=E,outQuad=y,inOutQuad=k,outInQuad=l,inCubic=z,outCubic=B,inOutCubic=j,outInCubic=e,inQuart=A,outQuart=H,inOutQuart=d,outInQuart=c,inQuint=D,outQuint=C,inOutQuint=f,outInQuint=g,inSine=w,outSine=L,inOutSine=i,outInSine=h,inExpo=I,outExpo=K,inOutExpo=t,outInExpo=n,inCirc=v,outCirc=x,inOutCirc=u,outInCirc=o,inElastic=G,outElastic=M,inOutElastic=q,outInElastic=p,inBack=J,outBack=F,inOutBack=r,outInBack=s,inBounce=N,outBounce=O,inOutBounce=b,outInBounce=a}
  2299. end))
  2300. ModuleScript62.Name = "Damping"
  2301. ModuleScript62.Parent = ModuleScript60
  2302. table.insert(cors,sandbox(ModuleScript62,function()
  2303. -- Damping
  2304. -- Crazyman32
  2305. -- September 30, 2015
  2306. -- Updated: January 1, 2017
  2307.  
  2308.  
  2309. --[[
  2310.  
  2311. local Damping = require(this)
  2312.  
  2313. local damping = Damping.new()
  2314.  
  2315. damping.P = NUMBER
  2316. damping.D = NUMBER
  2317. damping.Position = Vector3
  2318. damping.Goal = Vector3
  2319.  
  2320. damping:Update() [Returns Vector3 position]
  2321. damping:UpdateAngle() [Returns Vector3 position, but each XYZ value is wrapped properly for pi*2 motion]
  2322.  
  2323.  
  2324.  
  2325. EXAMPLE USE:
  2326.  
  2327. -- Set D and P values:
  2328. damping.P = 5
  2329. damping.D = 0.1
  2330.  
  2331. -- Set starting position:
  2332. damping.Position = part.Position
  2333.  
  2334. while (true) do
  2335.  
  2336. wait()
  2337.  
  2338. -- Update the goal:
  2339. damping.Goal = mouse.Hit.p
  2340.  
  2341. -- Calculate new position:
  2342. local newPosition = damping:Update()
  2343. part.Position = newPosition
  2344.  
  2345. end
  2346.  
  2347.  
  2348.  
  2349. ALGORITHM:
  2350.  
  2351. velocity += P * ( (target - current) + D * -velocity );
  2352. current += velocity * dt;
  2353.  
  2354. Credit: http://www.gamedev.net/topic/561981-smooth-value-damping/
  2355.  
  2356.  
  2357. --]]
  2358.  
  2359.  
  2360. local Damping = {}
  2361. Damping.__index = Damping
  2362.  
  2363. local V3 = Vector3.new
  2364. local PI = math.pi
  2365. local TAU = PI * 2
  2366. local tick = tick
  2367.  
  2368.  
  2369. local function CheckNAN(value, returnIfNan)
  2370. return (value == value and value or returnIfNan)
  2371. end
  2372.  
  2373.  
  2374. local function DeltaAngle(current, target)
  2375. local num = (target - current) % TAU
  2376. return (num > PI and (num - TAU) or num)
  2377. end
  2378.  
  2379.  
  2380. local function DeltaAngleV3(pos1, pos2)
  2381. return V3(
  2382. DeltaAngle(pos1.X, pos2.X),
  2383. DeltaAngle(pos1.Y, pos2.Y),
  2384. DeltaAngle(pos1.Z, pos2.Z)
  2385. )
  2386. end
  2387.  
  2388.  
  2389. function Damping.new()
  2390.  
  2391. local damping = setmetatable({
  2392. P = 5;
  2393. D = 0.1;
  2394. Position = V3();
  2395. Velocity = V3();
  2396. Goal = V3();
  2397. Last = tick();
  2398. }, Damping)
  2399.  
  2400. return damping
  2401.  
  2402. end
  2403.  
  2404.  
  2405. function Damping:CheckNAN()
  2406. self.Velocity = V3(CheckNAN(self.Velocity.X, 0), CheckNAN(self.Velocity.Y, 0), CheckNAN(self.Velocity.Z, 0))
  2407. self.Position = V3(CheckNAN(self.Position.X, self.Goal.X), CheckNAN(self.Position.Y, self.Goal.Y), CheckNAN(self.Position.Z, self.Goal.Z))
  2408. end
  2409.  
  2410.  
  2411. function Damping:Update()
  2412. local t = tick()
  2413. local dt = (t - self.Last)
  2414. self.Last = t
  2415. self.Velocity = (self.Velocity + (self.P * ((self.Goal - self.Position) + (-self.Velocity * self.D))))
  2416. self.Position = (self.Position + (self.Velocity * dt))
  2417. self:CheckNAN()
  2418. return self.Position
  2419. end
  2420.  
  2421.  
  2422. function Damping:UpdateAngle()
  2423. self.Goal = (self.Position + DeltaAngleV3(self.Position, self.Goal))
  2424. return self:Update()
  2425. end
  2426.  
  2427.  
  2428. return Damping
  2429. end))
  2430. ScreenGui63.Name = "PlaneConsoleGui"
  2431. ScreenGui63.Parent = LocalScript50
  2432. Frame64.Name = "Throttle"
  2433. Frame64.Parent = ScreenGui63
  2434. Frame64.Position = UDim2.new(0, 80, 1, -40)
  2435. Frame64.Size = UDim2.new(0, 350, 0, -20)
  2436. Frame64.BackgroundColor = BrickColor.new("Black")
  2437. Frame64.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2438. Frame64.BorderSizePixel = 0
  2439. TextLabel65.Name = "Label"
  2440. TextLabel65.Parent = Frame64
  2441. TextLabel65.Position = UDim2.new(0, 0, 0, -20)
  2442. TextLabel65.Size = UDim2.new(1, 0, 0, -20)
  2443. TextLabel65.BackgroundColor = BrickColor.new("Institutional white")
  2444. TextLabel65.BackgroundColor3 = Color3.new(1, 1, 1)
  2445. TextLabel65.BackgroundTransparency = 1
  2446. TextLabel65.Font = Enum.Font.SourceSans
  2447. TextLabel65.FontSize = Enum.FontSize.Size48
  2448. TextLabel65.Text = "THROTTLE"
  2449. TextLabel65.TextColor = BrickColor.new("Institutional white")
  2450. TextLabel65.TextColor3 = Color3.new(1, 1, 1)
  2451. TextLabel65.TextSize = 42
  2452. TextLabel65.TextStrokeTransparency = 0.80000001192093
  2453. TextLabel65.TextWrap = true
  2454. TextLabel65.TextWrapped = true
  2455. Frame66.Name = "Knob"
  2456. Frame66.Parent = Frame64
  2457. Frame66.Position = UDim2.new(0, 0, 0.5, -15)
  2458. Frame66.Size = UDim2.new(0, 20, 0, 30)
  2459. Frame66.BackgroundColor = BrickColor.new("Institutional white")
  2460. Frame66.BackgroundColor3 = Color3.new(1, 1, 1)
  2461. Frame66.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2462. Frame66.BorderSizePixel = 2
  2463. Frame66.ZIndex = 2
  2464. Frame67.Name = "Bar"
  2465. Frame67.Parent = Frame64
  2466. Frame67.Size = UDim2.new(0, 0, 1, 0)
  2467. Frame67.BackgroundColor = BrickColor.new("Institutional white")
  2468. Frame67.BackgroundColor3 = Color3.new(1, 1, 1)
  2469. Frame67.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2470. Frame67.BorderSizePixel = 2
  2471. TextButton68.Name = "Grab"
  2472. TextButton68.Parent = Frame64
  2473. TextButton68.Position = UDim2.new(0, -10, 0, -15)
  2474. TextButton68.Size = UDim2.new(1, 20, 1, 30)
  2475. TextButton68.BackgroundColor = BrickColor.new("Really red")
  2476. TextButton68.BackgroundColor3 = Color3.new(1, 0, 0)
  2477. TextButton68.BackgroundTransparency = 1
  2478. TextButton68.Draggable = true
  2479. TextButton68.ZIndex = 3
  2480. TextButton68.Font = Enum.Font.SourceSans
  2481. TextButton68.FontSize = Enum.FontSize.Size14
  2482. TextButton68.Text = ""
  2483. TextButton68.TextSize = 14
  2484. TextLabel69.Name = "RT"
  2485. TextLabel69.Parent = Frame64
  2486. TextLabel69.Position = UDim2.new(1, 10, 0, 0)
  2487. TextLabel69.Size = UDim2.new(0, 0, 1, 0)
  2488. TextLabel69.BackgroundColor = BrickColor.new("Institutional white")
  2489. TextLabel69.BackgroundColor3 = Color3.new(1, 1, 1)
  2490. TextLabel69.BackgroundTransparency = 1
  2491. TextLabel69.Font = Enum.Font.SourceSansBold
  2492. TextLabel69.FontSize = Enum.FontSize.Size48
  2493. TextLabel69.Text = "RT"
  2494. TextLabel69.TextColor = BrickColor.new("Institutional white")
  2495. TextLabel69.TextColor3 = Color3.new(1, 1, 1)
  2496. TextLabel69.TextSize = 42
  2497. TextLabel69.TextStrokeTransparency = 0.80000001192093
  2498. TextLabel69.TextWrap = true
  2499. TextLabel69.TextWrapped = true
  2500. TextLabel69.TextXAlignment = Enum.TextXAlignment.Left
  2501. TextLabel70.Name = "LT"
  2502. TextLabel70.Parent = Frame64
  2503. TextLabel70.Position = UDim2.new(0, -10, 0, 0)
  2504. TextLabel70.Size = UDim2.new(0, 0, 1, 0)
  2505. TextLabel70.BackgroundColor = BrickColor.new("Institutional white")
  2506. TextLabel70.BackgroundColor3 = Color3.new(1, 1, 1)
  2507. TextLabel70.BackgroundTransparency = 1
  2508. TextLabel70.Font = Enum.Font.SourceSansBold
  2509. TextLabel70.FontSize = Enum.FontSize.Size48
  2510. TextLabel70.Text = "LT"
  2511. TextLabel70.TextColor = BrickColor.new("Institutional white")
  2512. TextLabel70.TextColor3 = Color3.new(1, 1, 1)
  2513. TextLabel70.TextSize = 42
  2514. TextLabel70.TextStrokeTransparency = 0.80000001192093
  2515. TextLabel70.TextWrap = true
  2516. TextLabel70.TextWrapped = true
  2517. TextLabel70.TextXAlignment = Enum.TextXAlignment.Right
  2518. Frame71.Name = "Speed"
  2519. Frame71.Parent = ScreenGui63
  2520. Frame71.Position = UDim2.new(0, 550, 1, -30)
  2521. Frame71.Size = UDim2.new(0, 200, 0, -40)
  2522. Frame71.BackgroundColor = BrickColor.new("Black")
  2523. Frame71.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2524. Frame71.BorderSizePixel = 0
  2525. TextLabel72.Name = "Label"
  2526. TextLabel72.Parent = Frame71
  2527. TextLabel72.Position = UDim2.new(0, 0, 0, -10)
  2528. TextLabel72.Size = UDim2.new(1, 0, 0, -20)
  2529. TextLabel72.BackgroundColor = BrickColor.new("Institutional white")
  2530. TextLabel72.BackgroundColor3 = Color3.new(1, 1, 1)
  2531. TextLabel72.BackgroundTransparency = 1
  2532. TextLabel72.Font = Enum.Font.SourceSans
  2533. TextLabel72.FontSize = Enum.FontSize.Size48
  2534. TextLabel72.Text = "SPEED"
  2535. TextLabel72.TextColor = BrickColor.new("Institutional white")
  2536. TextLabel72.TextColor3 = Color3.new(1, 1, 1)
  2537. TextLabel72.TextSize = 42
  2538. TextLabel72.TextStrokeTransparency = 0.80000001192093
  2539. TextLabel72.TextWrap = true
  2540. TextLabel72.TextWrapped = true
  2541. TextLabel73.Name = "Amount"
  2542. TextLabel73.Parent = Frame71
  2543. TextLabel73.Size = UDim2.new(1, 0, 1, 0)
  2544. TextLabel73.BackgroundColor = BrickColor.new("Institutional white")
  2545. TextLabel73.BackgroundColor3 = Color3.new(1, 1, 1)
  2546. TextLabel73.BackgroundTransparency = 1
  2547. TextLabel73.Font = Enum.Font.Code
  2548. TextLabel73.FontSize = Enum.FontSize.Size14
  2549. TextLabel73.Text = "0"
  2550. TextLabel73.TextColor = BrickColor.new("Institutional white")
  2551. TextLabel73.TextColor3 = Color3.new(1, 1, 1)
  2552. TextLabel73.TextScaled = true
  2553. TextLabel73.TextSize = 14
  2554. TextLabel73.TextWrap = true
  2555. TextLabel73.TextWrapped = true
  2556. Frame74.Name = "Altitude"
  2557. Frame74.Parent = ScreenGui63
  2558. Frame74.Position = UDim2.new(0, 800, 1, -30)
  2559. Frame74.Size = UDim2.new(0, 200, 0, -40)
  2560. Frame74.BackgroundColor = BrickColor.new("Black")
  2561. Frame74.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2562. Frame74.BorderSizePixel = 0
  2563. TextLabel75.Name = "Label"
  2564. TextLabel75.Parent = Frame74
  2565. TextLabel75.Position = UDim2.new(0, 0, 0, -10)
  2566. TextLabel75.Size = UDim2.new(1, 0, 0, -20)
  2567. TextLabel75.BackgroundColor = BrickColor.new("Institutional white")
  2568. TextLabel75.BackgroundColor3 = Color3.new(1, 1, 1)
  2569. TextLabel75.BackgroundTransparency = 1
  2570. TextLabel75.Font = Enum.Font.SourceSans
  2571. TextLabel75.FontSize = Enum.FontSize.Size48
  2572. TextLabel75.Text = "ALTITUDE"
  2573. TextLabel75.TextColor = BrickColor.new("Institutional white")
  2574. TextLabel75.TextColor3 = Color3.new(1, 1, 1)
  2575. TextLabel75.TextSize = 42
  2576. TextLabel75.TextStrokeTransparency = 0.80000001192093
  2577. TextLabel75.TextWrap = true
  2578. TextLabel75.TextWrapped = true
  2579. TextLabel76.Name = "Amount"
  2580. TextLabel76.Parent = Frame74
  2581. TextLabel76.Size = UDim2.new(1, 0, 1, 0)
  2582. TextLabel76.BackgroundColor = BrickColor.new("Institutional white")
  2583. TextLabel76.BackgroundColor3 = Color3.new(1, 1, 1)
  2584. TextLabel76.BackgroundTransparency = 1
  2585. TextLabel76.Font = Enum.Font.Code
  2586. TextLabel76.FontSize = Enum.FontSize.Size14
  2587. TextLabel76.Text = "0"
  2588. TextLabel76.TextColor = BrickColor.new("Institutional white")
  2589. TextLabel76.TextColor3 = Color3.new(1, 1, 1)
  2590. TextLabel76.TextScaled = true
  2591. TextLabel76.TextSize = 14
  2592. TextLabel76.TextWrap = true
  2593. TextLabel76.TextWrapped = true
  2594. ModuleScript77.Name = "GuiController"
  2595. ModuleScript77.Parent = ScreenGui63
  2596. table.insert(cors,sandbox(ModuleScript77,function()
  2597. -- Gui Controller (For console)
  2598. -- Crazyman32
  2599. -- January 26, 2017
  2600.  
  2601.  
  2602.  
  2603. local GuiController = {
  2604. Throttle = 0;
  2605. }
  2606.  
  2607.  
  2608. local gui = script.Parent
  2609. local plane
  2610. local primary
  2611.  
  2612. local spd, alt
  2613.  
  2614. function ThrottleSetup()
  2615.  
  2616. local throttle = gui:WaitForChild("Throttle")
  2617. local grab = throttle:WaitForChild("Grab")
  2618. local bar = throttle:WaitForChild("Bar")
  2619. local knob = throttle:WaitForChild("Knob")
  2620.  
  2621. local grabPos = grab.Position
  2622. local grabSize = grab.Size
  2623.  
  2624. function GuiController:UpdateThrottle(throttle)
  2625. local xRatio = (throttle - 0.5) * 2
  2626. bar.Size = UDim2.new(xRatio, 0, 1, 0)
  2627. knob.Position = UDim2.new(xRatio, -knob.AbsoluteSize.X * xRatio, 0.5, -15)
  2628. end
  2629.  
  2630. end
  2631.  
  2632.  
  2633. function GuiController:Update()
  2634. spd.Text = tostring(math.floor(primary.Velocity.Magnitude))
  2635. alt.Text = tostring(math.floor(primary.Position.Y))
  2636. end
  2637.  
  2638.  
  2639. function GuiController:Start(p)
  2640. plane = p
  2641. primary = plane.PrimaryPart
  2642. ThrottleSetup()
  2643. spd = gui:WaitForChild("Speed"):WaitForChild("Amount")
  2644. alt = gui:WaitForChild("Altitude"):WaitForChild("Amount")
  2645. end
  2646.  
  2647.  
  2648. function GuiController:Stop()
  2649.  
  2650. end
  2651.  
  2652.  
  2653. return GuiController
  2654. end))
  2655. ScreenGui78.Name = "PlaneGui"
  2656. ScreenGui78.Parent = LocalScript50
  2657. Frame79.Name = "Throttle"
  2658. Frame79.Parent = ScreenGui78
  2659. Frame79.Position = UDim2.new(0, 80, 1, -40)
  2660. Frame79.Size = UDim2.new(0, 350, 0, -20)
  2661. Frame79.BackgroundColor = BrickColor.new("Black")
  2662. Frame79.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2663. Frame79.BorderSizePixel = 0
  2664. TextLabel80.Name = "Label"
  2665. TextLabel80.Parent = Frame79
  2666. TextLabel80.Position = UDim2.new(0, 0, 0, -20)
  2667. TextLabel80.Size = UDim2.new(1, 0, 0, -20)
  2668. TextLabel80.BackgroundColor = BrickColor.new("Institutional white")
  2669. TextLabel80.BackgroundColor3 = Color3.new(1, 1, 1)
  2670. TextLabel80.BackgroundTransparency = 1
  2671. TextLabel80.Font = Enum.Font.SourceSans
  2672. TextLabel80.FontSize = Enum.FontSize.Size48
  2673. TextLabel80.Text = "THROTTLE"
  2674. TextLabel80.TextColor = BrickColor.new("Institutional white")
  2675. TextLabel80.TextColor3 = Color3.new(1, 1, 1)
  2676. TextLabel80.TextSize = 42
  2677. TextLabel80.TextStrokeTransparency = 0.80000001192093
  2678. TextLabel80.TextWrap = true
  2679. TextLabel80.TextWrapped = true
  2680. Frame81.Name = "Knob"
  2681. Frame81.Parent = Frame79
  2682. Frame81.Position = UDim2.new(0, 0, 0.5, -15)
  2683. Frame81.Size = UDim2.new(0, 20, 0, 30)
  2684. Frame81.BackgroundColor = BrickColor.new("Institutional white")
  2685. Frame81.BackgroundColor3 = Color3.new(1, 1, 1)
  2686. Frame81.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2687. Frame81.BorderSizePixel = 2
  2688. Frame81.ZIndex = 2
  2689. Frame82.Name = "Bar"
  2690. Frame82.Parent = Frame79
  2691. Frame82.Size = UDim2.new(0, 0, 1, 0)
  2692. Frame82.BackgroundColor = BrickColor.new("Institutional white")
  2693. Frame82.BackgroundColor3 = Color3.new(1, 1, 1)
  2694. Frame82.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2695. Frame82.BorderSizePixel = 2
  2696. TextButton83.Name = "Grab"
  2697. TextButton83.Parent = Frame79
  2698. TextButton83.Position = UDim2.new(0, -10, 0, -15)
  2699. TextButton83.Size = UDim2.new(1, 20, 1, 30)
  2700. TextButton83.BackgroundColor = BrickColor.new("Really red")
  2701. TextButton83.BackgroundColor3 = Color3.new(1, 0, 0)
  2702. TextButton83.BackgroundTransparency = 1
  2703. TextButton83.Draggable = true
  2704. TextButton83.ZIndex = 3
  2705. TextButton83.Font = Enum.Font.SourceSans
  2706. TextButton83.FontSize = Enum.FontSize.Size14
  2707. TextButton83.Text = ""
  2708. TextButton83.TextSize = 14
  2709. TextLabel84.Name = "RT"
  2710. TextLabel84.Parent = Frame79
  2711. TextLabel84.Position = UDim2.new(1, 10, 0, 0)
  2712. TextLabel84.Size = UDim2.new(0, 0, 1, 0)
  2713. TextLabel84.BackgroundColor = BrickColor.new("Institutional white")
  2714. TextLabel84.BackgroundColor3 = Color3.new(1, 1, 1)
  2715. TextLabel84.BackgroundTransparency = 1
  2716. TextLabel84.Font = Enum.Font.SourceSansBold
  2717. TextLabel84.FontSize = Enum.FontSize.Size48
  2718. TextLabel84.Text = "RT"
  2719. TextLabel84.TextColor = BrickColor.new("Institutional white")
  2720. TextLabel84.TextColor3 = Color3.new(1, 1, 1)
  2721. TextLabel84.TextSize = 42
  2722. TextLabel84.TextStrokeTransparency = 0.80000001192093
  2723. TextLabel84.TextWrap = true
  2724. TextLabel84.TextWrapped = true
  2725. TextLabel84.TextXAlignment = Enum.TextXAlignment.Left
  2726. TextLabel85.Name = "LT"
  2727. TextLabel85.Parent = Frame79
  2728. TextLabel85.Position = UDim2.new(0, -10, 0, 0)
  2729. TextLabel85.Size = UDim2.new(0, 0, 1, 0)
  2730. TextLabel85.BackgroundColor = BrickColor.new("Institutional white")
  2731. TextLabel85.BackgroundColor3 = Color3.new(1, 1, 1)
  2732. TextLabel85.BackgroundTransparency = 1
  2733. TextLabel85.Font = Enum.Font.SourceSansBold
  2734. TextLabel85.FontSize = Enum.FontSize.Size48
  2735. TextLabel85.Text = "LT"
  2736. TextLabel85.TextColor = BrickColor.new("Institutional white")
  2737. TextLabel85.TextColor3 = Color3.new(1, 1, 1)
  2738. TextLabel85.TextSize = 42
  2739. TextLabel85.TextStrokeTransparency = 0.80000001192093
  2740. TextLabel85.TextWrap = true
  2741. TextLabel85.TextWrapped = true
  2742. TextLabel85.TextXAlignment = Enum.TextXAlignment.Right
  2743. Frame86.Name = "Speed"
  2744. Frame86.Parent = ScreenGui78
  2745. Frame86.Position = UDim2.new(0, 550, 1, -30)
  2746. Frame86.Size = UDim2.new(0, 200, 0, -40)
  2747. Frame86.BackgroundColor = BrickColor.new("Black")
  2748. Frame86.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2749. Frame86.BorderSizePixel = 0
  2750. TextLabel87.Name = "Label"
  2751. TextLabel87.Parent = Frame86
  2752. TextLabel87.Position = UDim2.new(0, 0, 0, -10)
  2753. TextLabel87.Size = UDim2.new(1, 0, 0, -20)
  2754. TextLabel87.BackgroundColor = BrickColor.new("Institutional white")
  2755. TextLabel87.BackgroundColor3 = Color3.new(1, 1, 1)
  2756. TextLabel87.BackgroundTransparency = 1
  2757. TextLabel87.Font = Enum.Font.SourceSans
  2758. TextLabel87.FontSize = Enum.FontSize.Size48
  2759. TextLabel87.Text = "SPEED"
  2760. TextLabel87.TextColor = BrickColor.new("Institutional white")
  2761. TextLabel87.TextColor3 = Color3.new(1, 1, 1)
  2762. TextLabel87.TextSize = 42
  2763. TextLabel87.TextStrokeTransparency = 0.80000001192093
  2764. TextLabel87.TextWrap = true
  2765. TextLabel87.TextWrapped = true
  2766. TextLabel88.Name = "Amount"
  2767. TextLabel88.Parent = Frame86
  2768. TextLabel88.Size = UDim2.new(1, 0, 1, 0)
  2769. TextLabel88.BackgroundColor = BrickColor.new("Institutional white")
  2770. TextLabel88.BackgroundColor3 = Color3.new(1, 1, 1)
  2771. TextLabel88.BackgroundTransparency = 1
  2772. TextLabel88.Font = Enum.Font.Code
  2773. TextLabel88.FontSize = Enum.FontSize.Size14
  2774. TextLabel88.Text = "0"
  2775. TextLabel88.TextColor = BrickColor.new("Institutional white")
  2776. TextLabel88.TextColor3 = Color3.new(1, 1, 1)
  2777. TextLabel88.TextScaled = true
  2778. TextLabel88.TextSize = 14
  2779. TextLabel88.TextWrap = true
  2780. TextLabel88.TextWrapped = true
  2781. Frame89.Name = "Altitude"
  2782. Frame89.Parent = ScreenGui78
  2783. Frame89.Position = UDim2.new(0, 800, 1, -30)
  2784. Frame89.Size = UDim2.new(0, 200, 0, -40)
  2785. Frame89.BackgroundColor = BrickColor.new("Black")
  2786. Frame89.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2787. Frame89.BorderSizePixel = 0
  2788. TextLabel90.Name = "Label"
  2789. TextLabel90.Parent = Frame89
  2790. TextLabel90.Position = UDim2.new(0, 0, 0, -10)
  2791. TextLabel90.Size = UDim2.new(1, 0, 0, -20)
  2792. TextLabel90.BackgroundColor = BrickColor.new("Institutional white")
  2793. TextLabel90.BackgroundColor3 = Color3.new(1, 1, 1)
  2794. TextLabel90.BackgroundTransparency = 1
  2795. TextLabel90.Font = Enum.Font.SourceSans
  2796. TextLabel90.FontSize = Enum.FontSize.Size48
  2797. TextLabel90.Text = "ALTITUDE"
  2798. TextLabel90.TextColor = BrickColor.new("Institutional white")
  2799. TextLabel90.TextColor3 = Color3.new(1, 1, 1)
  2800. TextLabel90.TextSize = 42
  2801. TextLabel90.TextStrokeTransparency = 0.80000001192093
  2802. TextLabel90.TextWrap = true
  2803. TextLabel90.TextWrapped = true
  2804. TextLabel91.Name = "Amount"
  2805. TextLabel91.Parent = Frame89
  2806. TextLabel91.Size = UDim2.new(1, 0, 1, 0)
  2807. TextLabel91.BackgroundColor = BrickColor.new("Institutional white")
  2808. TextLabel91.BackgroundColor3 = Color3.new(1, 1, 1)
  2809. TextLabel91.BackgroundTransparency = 1
  2810. TextLabel91.Font = Enum.Font.Code
  2811. TextLabel91.FontSize = Enum.FontSize.Size14
  2812. TextLabel91.Text = "0"
  2813. TextLabel91.TextColor = BrickColor.new("Institutional white")
  2814. TextLabel91.TextColor3 = Color3.new(1, 1, 1)
  2815. TextLabel91.TextScaled = true
  2816. TextLabel91.TextSize = 14
  2817. TextLabel91.TextWrap = true
  2818. TextLabel91.TextWrapped = true
  2819. ModuleScript92.Name = "GuiController"
  2820. ModuleScript92.Parent = ScreenGui78
  2821. table.insert(cors,sandbox(ModuleScript92,function()
  2822. -- Gui Controller (For PC)
  2823. -- Crazyman32
  2824. -- January 26, 2017
  2825.  
  2826. --[[
  2827.  
  2828. GuiController:Start(plane)
  2829. GuiController:Stop()
  2830. GuiController:Update()
  2831. GuiController:UpdateThrottle(throttle)
  2832. GuiController:SetUsingGamepad(isUsingGamepad)
  2833.  
  2834. --]]
  2835.  
  2836.  
  2837.  
  2838. local GuiController = {
  2839. UseMouse = true;
  2840. InvertPitch = false;
  2841. }
  2842.  
  2843.  
  2844. local gui = script.Parent
  2845. local plane
  2846. local primary
  2847.  
  2848. local spd, alt, throttleRT, throttleLT
  2849.  
  2850. function ThrottleSetup()
  2851.  
  2852. local throttle = gui:WaitForChild("Throttle")
  2853. local grab = throttle:WaitForChild("Grab")
  2854. local bar = throttle:WaitForChild("Bar")
  2855. local knob = throttle:WaitForChild("Knob")
  2856.  
  2857. local grabPos = grab.Position
  2858. local grabSize = grab.Size
  2859.  
  2860. function GuiController:UpdateThrottle(throttle)
  2861. local xRatio = (throttle - 0.5) * 2
  2862. bar.Size = UDim2.new(xRatio, 0, 1, 0)
  2863. knob.Position = UDim2.new(xRatio, -knob.AbsoluteSize.X * xRatio, 0.5, -15)
  2864. end
  2865.  
  2866. end
  2867.  
  2868.  
  2869. -- Toggle switch:
  2870. function SwitchSetup(frame, defaultState, changedCallback)
  2871.  
  2872. local OFF_POS = UDim2.new(0, 0, 0, 0)
  2873. local ON_POS = UDim2.new(0.5, 0, 0, 0)
  2874. local TWEEN_DURATION = 0.25
  2875. local TWEEN_EASE = "Quint"
  2876. local TWEEN_DIR = "Out"
  2877.  
  2878. local switch = frame:WaitForChild("Switch")
  2879. local slider = switch:WaitForChild("Slider")
  2880. local sliderLbl = slider:WaitForChild("Label")
  2881. local state = (not not defaultState) -- A funny way to cast to a boolean in Lua
  2882. local active = false
  2883.  
  2884. local function StateChanged()
  2885. slider:TweenPosition(state and ON_POS or OFF_POS, TWEEN_DIR, TWEEN_EASE, TWEEN_DURATION, true)
  2886. sliderLbl.Text = (state and "YES" or "NO")
  2887. changedCallback(state)
  2888. end
  2889.  
  2890. local function Clicked()
  2891. if (active) then return end
  2892. active = true
  2893. state = not state
  2894. delay(TWEEN_DURATION, function()
  2895. active = false
  2896. end)
  2897. StateChanged()
  2898. end
  2899.  
  2900. switch.MouseButton1Click:Connect(Clicked)
  2901. StateChanged()
  2902.  
  2903. end
  2904.  
  2905.  
  2906. function GuiController:SetUsingGamepad(isUsingGamepad)
  2907. gui.Controls.Visible = false
  2908. gui.ControlsButton.Visible = not isUsingGamepad
  2909. throttleRT.Text = (isUsingGamepad and "RT" or self.UseMouse and "W" or "X")
  2910. throttleLT.Text = (isUsingGamepad and "LT" or self.UseMouse and "S" or "Z")
  2911. end
  2912.  
  2913.  
  2914. function GuiController:Update()
  2915. spd.Text = tostring(math.floor(primary.Velocity.Magnitude))
  2916. alt.Text = tostring(math.floor(primary.Position.Y))
  2917. end
  2918.  
  2919.  
  2920. function GuiController:Start(p)
  2921.  
  2922. plane = p
  2923. primary = plane.PrimaryPart
  2924.  
  2925. ThrottleSetup()
  2926.  
  2927. spd = gui:WaitForChild("Speed"):WaitForChild("Amount")
  2928. alt = gui:WaitForChild("Altitude"):WaitForChild("Amount")
  2929. throttleRT = gui:WaitForChild("Throttle"):WaitForChild("RT")
  2930. throttleLT = gui:WaitForChild("Throttle"):WaitForChild("LT")
  2931.  
  2932. local controls = gui:WaitForChild("Controls")
  2933. local listKeyboard = controls:WaitForChild("ListKeyboard")
  2934. local listKeyboardMouse = controls:WaitForChild("ListKeyboardMouse")
  2935.  
  2936. controls.Visible = false
  2937.  
  2938. -- ControlButton clicked:
  2939. gui:WaitForChild("ControlsButton").MouseButton1Click:Connect(function()
  2940. controls.Visible = not controls.Visible
  2941. end)
  2942.  
  2943. -- InvertSwitch toggled:
  2944. SwitchSetup(controls:WaitForChild("InvertSwitch"), self.InvertPitch, function(inverted)
  2945. self.InvertPitch = inverted
  2946. end)
  2947.  
  2948. -- MouseSwitch toggled:
  2949. SwitchSetup(controls:WaitForChild("MouseSwitch"), self.UseMouse, function(useMouse)
  2950. self.UseMouse = useMouse
  2951. listKeyboard.Visible = not useMouse
  2952. listKeyboardMouse.Visible = useMouse
  2953. throttleRT.Text = (useMouse and "W" or "X")
  2954. throttleLT.Text = (useMouse and "S" or "Z")
  2955. end)
  2956.  
  2957. -- Control Exit clicked:
  2958. controls:WaitForChild("Exit").MouseButton1Click:Connect(function()
  2959. controls.Visible = false
  2960. end)
  2961.  
  2962. end
  2963.  
  2964.  
  2965. function GuiController:Stop()
  2966.  
  2967. end
  2968.  
  2969.  
  2970. return GuiController
  2971. end))
  2972. TextButton93.Name = "ControlsButton"
  2973. TextButton93.Parent = ScreenGui78
  2974. TextButton93.Position = UDim2.new(1, -230, 1, -30)
  2975. TextButton93.Size = UDim2.new(0, 200, 0, -40)
  2976. TextButton93.BackgroundColor = BrickColor.new("Institutional white")
  2977. TextButton93.BackgroundColor3 = Color3.new(1, 1, 1)
  2978. TextButton93.BorderSizePixel = 0
  2979. TextButton93.Font = Enum.Font.SourceSansBold
  2980. TextButton93.FontSize = Enum.FontSize.Size36
  2981. TextButton93.Text = "CONTROLS"
  2982. TextButton93.TextColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2983. TextButton93.TextSize = 36
  2984. Frame94.Name = "Controls"
  2985. Frame94.Parent = ScreenGui78
  2986. Frame94.Position = UDim2.new(0.5, 0, 0, 30)
  2987. Frame94.Visible = false
  2988. Frame94.Size = UDim2.new(0, 400, 0, 300)
  2989. Frame94.Active = true
  2990. Frame94.AnchorPoint = Vector2.new(0.5, 0)
  2991. Frame94.BackgroundColor = BrickColor.new("Black")
  2992. Frame94.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  2993. Frame94.Draggable = true
  2994. TextLabel95.Name = "Title"
  2995. TextLabel95.Parent = Frame94
  2996. TextLabel95.Size = UDim2.new(1, 0, 0, 30)
  2997. TextLabel95.BackgroundColor = BrickColor.new("Institutional white")
  2998. TextLabel95.BackgroundColor3 = Color3.new(1, 1, 1)
  2999. TextLabel95.BackgroundTransparency = 1
  3000. TextLabel95.Font = Enum.Font.SourceSansBold
  3001. TextLabel95.FontSize = Enum.FontSize.Size36
  3002. TextLabel95.Text = "CONTROLS"
  3003. TextLabel95.TextColor = BrickColor.new("Institutional white")
  3004. TextLabel95.TextColor3 = Color3.new(1, 1, 1)
  3005. TextLabel95.TextSize = 36
  3006. TextButton96.Name = "Exit"
  3007. TextButton96.Parent = Frame94
  3008. TextButton96.Position = UDim2.new(1, 5, 0, -5)
  3009. TextButton96.Size = UDim2.new(0, -30, 0, 30)
  3010. TextButton96.BackgroundColor = BrickColor.new("Institutional white")
  3011. TextButton96.BackgroundColor3 = Color3.new(1, 1, 1)
  3012. TextButton96.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3013. TextButton96.BorderSizePixel = 2
  3014. TextButton96.Font = Enum.Font.SourceSansBold
  3015. TextButton96.FontSize = Enum.FontSize.Size36
  3016. TextButton96.Text = "X"
  3017. TextButton96.TextColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3018. TextButton96.TextSize = 36
  3019. Frame97.Name = "ListKeyboardMouse"
  3020. Frame97.Parent = Frame94
  3021. Frame97.Position = UDim2.new(0, 10, 0, 40)
  3022. Frame97.Visible = false
  3023. Frame97.Size = UDim2.new(1, -20, 1, -100)
  3024. Frame97.BackgroundColor = BrickColor.new("Institutional white")
  3025. Frame97.BackgroundColor3 = Color3.new(1, 1, 1)
  3026. Frame97.BackgroundTransparency = 1
  3027. Frame98.Name = "Control01"
  3028. Frame98.Parent = Frame97
  3029. Frame98.Size = UDim2.new(1, 0, 0, 30)
  3030. Frame98.BackgroundColor = BrickColor.new("Institutional white")
  3031. Frame98.BackgroundColor3 = Color3.new(1, 1, 1)
  3032. Frame98.BackgroundTransparency = 1
  3033. TextLabel99.Name = "Label"
  3034. TextLabel99.Parent = Frame98
  3035. TextLabel99.Size = UDim2.new(1, 0, 1, 0)
  3036. TextLabel99.BackgroundColor = BrickColor.new("Institutional white")
  3037. TextLabel99.BackgroundColor3 = Color3.new(1, 1, 1)
  3038. TextLabel99.BackgroundTransparency = 1
  3039. TextLabel99.Font = Enum.Font.SourceSans
  3040. TextLabel99.FontSize = Enum.FontSize.Size28
  3041. TextLabel99.Text = "Pitch & Roll"
  3042. TextLabel99.TextColor = BrickColor.new("Institutional white")
  3043. TextLabel99.TextColor3 = Color3.new(1, 1, 1)
  3044. TextLabel99.TextSize = 28
  3045. TextLabel99.TextXAlignment = Enum.TextXAlignment.Left
  3046. TextLabel100.Name = "Control"
  3047. TextLabel100.Parent = Frame98
  3048. TextLabel100.Size = UDim2.new(1, 0, 1, 0)
  3049. TextLabel100.BackgroundColor = BrickColor.new("Institutional white")
  3050. TextLabel100.BackgroundColor3 = Color3.new(1, 1, 1)
  3051. TextLabel100.BackgroundTransparency = 1
  3052. TextLabel100.Font = Enum.Font.SourceSans
  3053. TextLabel100.FontSize = Enum.FontSize.Size28
  3054. TextLabel100.Text = "Mouse"
  3055. TextLabel100.TextColor = BrickColor.new("Institutional white")
  3056. TextLabel100.TextColor3 = Color3.new(1, 1, 1)
  3057. TextLabel100.TextSize = 28
  3058. TextLabel100.TextXAlignment = Enum.TextXAlignment.Right
  3059. Frame101.Name = "Divider"
  3060. Frame101.Parent = Frame98
  3061. Frame101.Position = UDim2.new(0, 0, 1, 0)
  3062. Frame101.Size = UDim2.new(1, 0, 0, 1)
  3063. Frame101.BackgroundColor = BrickColor.new("Sand red")
  3064. Frame101.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3065. Frame101.BorderSizePixel = 0
  3066. Frame102.Name = "Control02"
  3067. Frame102.Parent = Frame97
  3068. Frame102.Position = UDim2.new(0, 0, 0, 30)
  3069. Frame102.Size = UDim2.new(1, 0, 0, 30)
  3070. Frame102.BackgroundColor = BrickColor.new("Institutional white")
  3071. Frame102.BackgroundColor3 = Color3.new(1, 1, 1)
  3072. Frame102.BackgroundTransparency = 1
  3073. TextLabel103.Name = "Label"
  3074. TextLabel103.Parent = Frame102
  3075. TextLabel103.Size = UDim2.new(1, 0, 1, 0)
  3076. TextLabel103.BackgroundColor = BrickColor.new("Institutional white")
  3077. TextLabel103.BackgroundColor3 = Color3.new(1, 1, 1)
  3078. TextLabel103.BackgroundTransparency = 1
  3079. TextLabel103.Font = Enum.Font.SourceSans
  3080. TextLabel103.FontSize = Enum.FontSize.Size28
  3081. TextLabel103.Text = "Yaw (Rudder)"
  3082. TextLabel103.TextColor = BrickColor.new("Institutional white")
  3083. TextLabel103.TextColor3 = Color3.new(1, 1, 1)
  3084. TextLabel103.TextSize = 28
  3085. TextLabel103.TextXAlignment = Enum.TextXAlignment.Left
  3086. TextLabel104.Name = "Control"
  3087. TextLabel104.Parent = Frame102
  3088. TextLabel104.Size = UDim2.new(1, 0, 1, 0)
  3089. TextLabel104.BackgroundColor = BrickColor.new("Institutional white")
  3090. TextLabel104.BackgroundColor3 = Color3.new(1, 1, 1)
  3091. TextLabel104.BackgroundTransparency = 1
  3092. TextLabel104.Font = Enum.Font.SourceSans
  3093. TextLabel104.FontSize = Enum.FontSize.Size28
  3094. TextLabel104.Text = "A & D"
  3095. TextLabel104.TextColor = BrickColor.new("Institutional white")
  3096. TextLabel104.TextColor3 = Color3.new(1, 1, 1)
  3097. TextLabel104.TextSize = 28
  3098. TextLabel104.TextXAlignment = Enum.TextXAlignment.Right
  3099. Frame105.Name = "Divider"
  3100. Frame105.Parent = Frame102
  3101. Frame105.Position = UDim2.new(0, 0, 1, 0)
  3102. Frame105.Size = UDim2.new(1, 0, 0, 1)
  3103. Frame105.BackgroundColor = BrickColor.new("Sand red")
  3104. Frame105.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3105. Frame105.BorderSizePixel = 0
  3106. Frame106.Name = "Control03"
  3107. Frame106.Parent = Frame97
  3108. Frame106.Position = UDim2.new(0, 0, 0, 60)
  3109. Frame106.Size = UDim2.new(1, 0, 0, 30)
  3110. Frame106.BackgroundColor = BrickColor.new("Institutional white")
  3111. Frame106.BackgroundColor3 = Color3.new(1, 1, 1)
  3112. Frame106.BackgroundTransparency = 1
  3113. TextLabel107.Name = "Label"
  3114. TextLabel107.Parent = Frame106
  3115. TextLabel107.Size = UDim2.new(1, 0, 1, 0)
  3116. TextLabel107.BackgroundColor = BrickColor.new("Institutional white")
  3117. TextLabel107.BackgroundColor3 = Color3.new(1, 1, 1)
  3118. TextLabel107.BackgroundTransparency = 1
  3119. TextLabel107.Font = Enum.Font.SourceSans
  3120. TextLabel107.FontSize = Enum.FontSize.Size28
  3121. TextLabel107.Text = "Throttle"
  3122. TextLabel107.TextColor = BrickColor.new("Institutional white")
  3123. TextLabel107.TextColor3 = Color3.new(1, 1, 1)
  3124. TextLabel107.TextSize = 28
  3125. TextLabel107.TextXAlignment = Enum.TextXAlignment.Left
  3126. TextLabel108.Name = "Control"
  3127. TextLabel108.Parent = Frame106
  3128. TextLabel108.Size = UDim2.new(1, 0, 1, 0)
  3129. TextLabel108.BackgroundColor = BrickColor.new("Institutional white")
  3130. TextLabel108.BackgroundColor3 = Color3.new(1, 1, 1)
  3131. TextLabel108.BackgroundTransparency = 1
  3132. TextLabel108.Font = Enum.Font.SourceSans
  3133. TextLabel108.FontSize = Enum.FontSize.Size28
  3134. TextLabel108.Text = "W & S"
  3135. TextLabel108.TextColor = BrickColor.new("Institutional white")
  3136. TextLabel108.TextColor3 = Color3.new(1, 1, 1)
  3137. TextLabel108.TextSize = 28
  3138. TextLabel108.TextXAlignment = Enum.TextXAlignment.Right
  3139. Frame109.Name = "Divider"
  3140. Frame109.Parent = Frame106
  3141. Frame109.Position = UDim2.new(0, 0, 1, 0)
  3142. Frame109.Size = UDim2.new(1, 0, 0, 1)
  3143. Frame109.BackgroundColor = BrickColor.new("Sand red")
  3144. Frame109.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3145. Frame109.BorderSizePixel = 0
  3146. Frame110.Name = "Control04"
  3147. Frame110.Parent = Frame97
  3148. Frame110.Position = UDim2.new(0, 0, 0, 90)
  3149. Frame110.Size = UDim2.new(1, 0, 0, 30)
  3150. Frame110.BackgroundColor = BrickColor.new("Institutional white")
  3151. Frame110.BackgroundColor3 = Color3.new(1, 1, 1)
  3152. Frame110.BackgroundTransparency = 1
  3153. TextLabel111.Name = "Label"
  3154. TextLabel111.Parent = Frame110
  3155. TextLabel111.Size = UDim2.new(1, 0, 1, 0)
  3156. TextLabel111.BackgroundColor = BrickColor.new("Institutional white")
  3157. TextLabel111.BackgroundColor3 = Color3.new(1, 1, 1)
  3158. TextLabel111.BackgroundTransparency = 1
  3159. TextLabel111.Font = Enum.Font.SourceSans
  3160. TextLabel111.FontSize = Enum.FontSize.Size28
  3161. TextLabel111.Text = "Camera View"
  3162. TextLabel111.TextColor = BrickColor.new("Institutional white")
  3163. TextLabel111.TextColor3 = Color3.new(1, 1, 1)
  3164. TextLabel111.TextSize = 28
  3165. TextLabel111.TextXAlignment = Enum.TextXAlignment.Left
  3166. TextLabel112.Name = "Control"
  3167. TextLabel112.Parent = Frame110
  3168. TextLabel112.Size = UDim2.new(1, 0, 1, 0)
  3169. TextLabel112.BackgroundColor = BrickColor.new("Institutional white")
  3170. TextLabel112.BackgroundColor3 = Color3.new(1, 1, 1)
  3171. TextLabel112.BackgroundTransparency = 1
  3172. TextLabel112.Font = Enum.Font.SourceSans
  3173. TextLabel112.FontSize = Enum.FontSize.Size28
  3174. TextLabel112.Text = "C"
  3175. TextLabel112.TextColor = BrickColor.new("Institutional white")
  3176. TextLabel112.TextColor3 = Color3.new(1, 1, 1)
  3177. TextLabel112.TextSize = 28
  3178. TextLabel112.TextXAlignment = Enum.TextXAlignment.Right
  3179. Frame113.Name = "Divider"
  3180. Frame113.Parent = Frame110
  3181. Frame113.Position = UDim2.new(0, 0, 1, 0)
  3182. Frame113.Size = UDim2.new(1, 0, 0, 1)
  3183. Frame113.BackgroundColor = BrickColor.new("Sand red")
  3184. Frame113.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3185. Frame113.BorderSizePixel = 0
  3186. Frame114.Name = "MouseSwitch"
  3187. Frame114.Parent = Frame94
  3188. Frame114.Position = UDim2.new(0, 10, 1, -10)
  3189. Frame114.Size = UDim2.new(1, -20, 0, -40)
  3190. Frame114.BackgroundColor = BrickColor.new("Institutional white")
  3191. Frame114.BackgroundColor3 = Color3.new(1, 1, 1)
  3192. Frame114.BackgroundTransparency = 1
  3193. TextLabel115.Name = "Label"
  3194. TextLabel115.Parent = Frame114
  3195. TextLabel115.Size = UDim2.new(1, 0, 1, 0)
  3196. TextLabel115.BackgroundColor = BrickColor.new("Institutional white")
  3197. TextLabel115.BackgroundColor3 = Color3.new(1, 1, 1)
  3198. TextLabel115.BackgroundTransparency = 1
  3199. TextLabel115.Font = Enum.Font.SourceSans
  3200. TextLabel115.FontSize = Enum.FontSize.Size24
  3201. TextLabel115.Text = "Use Mouse:"
  3202. TextLabel115.TextColor = BrickColor.new("Institutional white")
  3203. TextLabel115.TextColor3 = Color3.new(1, 1, 1)
  3204. TextLabel115.TextSize = 24
  3205. TextLabel115.TextXAlignment = Enum.TextXAlignment.Left
  3206. TextButton116.Name = "Switch"
  3207. TextButton116.Parent = Frame114
  3208. TextButton116.Position = UDim2.new(1, 0, 0, 0)
  3209. TextButton116.Size = UDim2.new(-0.5, 0, 1, 0)
  3210. TextButton116.BackgroundColor = BrickColor.new("Institutional white")
  3211. TextButton116.BackgroundColor3 = Color3.new(1, 1, 1)
  3212. TextButton116.BorderSizePixel = 0
  3213. TextButton116.Font = Enum.Font.SourceSans
  3214. TextButton116.FontSize = Enum.FontSize.Size14
  3215. TextButton116.Text = ""
  3216. TextButton116.TextSize = 14
  3217. TextButton116.TextTransparency = 1
  3218. Frame117.Name = "Slider"
  3219. Frame117.Parent = TextButton116
  3220. Frame117.Size = UDim2.new(0.5, 0, 1, 0)
  3221. Frame117.BackgroundColor = BrickColor.new("Institutional white")
  3222. Frame117.BackgroundColor3 = Color3.new(1, 1, 1)
  3223. Frame117.BackgroundTransparency = 1
  3224. Frame117.BorderSizePixel = 0
  3225. TextLabel118.Name = "Label"
  3226. TextLabel118.Parent = Frame117
  3227. TextLabel118.Position = UDim2.new(0, 5, 0, 5)
  3228. TextLabel118.Size = UDim2.new(1, -10, 1, -10)
  3229. TextLabel118.BackgroundColor = BrickColor.new("Sand red")
  3230. TextLabel118.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3231. TextLabel118.BorderSizePixel = 0
  3232. TextLabel118.Font = Enum.Font.SourceSansBold
  3233. TextLabel118.FontSize = Enum.FontSize.Size24
  3234. TextLabel118.Text = "YES"
  3235. TextLabel118.TextColor = BrickColor.new("Institutional white")
  3236. TextLabel118.TextColor3 = Color3.new(1, 1, 1)
  3237. TextLabel118.TextSize = 24
  3238. Frame119.Name = "ListKeyboard"
  3239. Frame119.Parent = Frame94
  3240. Frame119.Position = UDim2.new(0, 10, 0, 40)
  3241. Frame119.Size = UDim2.new(1, -20, 1, -100)
  3242. Frame119.BackgroundColor = BrickColor.new("Institutional white")
  3243. Frame119.BackgroundColor3 = Color3.new(1, 1, 1)
  3244. Frame119.BackgroundTransparency = 1
  3245. Frame120.Name = "Control01"
  3246. Frame120.Parent = Frame119
  3247. Frame120.Size = UDim2.new(1, 0, 0, 30)
  3248. Frame120.BackgroundColor = BrickColor.new("Institutional white")
  3249. Frame120.BackgroundColor3 = Color3.new(1, 1, 1)
  3250. Frame120.BackgroundTransparency = 1
  3251. TextLabel121.Name = "Label"
  3252. TextLabel121.Parent = Frame120
  3253. TextLabel121.Size = UDim2.new(1, 0, 1, 0)
  3254. TextLabel121.BackgroundColor = BrickColor.new("Institutional white")
  3255. TextLabel121.BackgroundColor3 = Color3.new(1, 1, 1)
  3256. TextLabel121.BackgroundTransparency = 1
  3257. TextLabel121.Font = Enum.Font.SourceSans
  3258. TextLabel121.FontSize = Enum.FontSize.Size28
  3259. TextLabel121.Text = "Pitch & Roll"
  3260. TextLabel121.TextColor = BrickColor.new("Institutional white")
  3261. TextLabel121.TextColor3 = Color3.new(1, 1, 1)
  3262. TextLabel121.TextSize = 28
  3263. TextLabel121.TextXAlignment = Enum.TextXAlignment.Left
  3264. TextLabel122.Name = "Control"
  3265. TextLabel122.Parent = Frame120
  3266. TextLabel122.Size = UDim2.new(1, 0, 1, 0)
  3267. TextLabel122.BackgroundColor = BrickColor.new("Institutional white")
  3268. TextLabel122.BackgroundColor3 = Color3.new(1, 1, 1)
  3269. TextLabel122.BackgroundTransparency = 1
  3270. TextLabel122.Font = Enum.Font.SourceSans
  3271. TextLabel122.FontSize = Enum.FontSize.Size28
  3272. TextLabel122.Text = "WASD"
  3273. TextLabel122.TextColor = BrickColor.new("Institutional white")
  3274. TextLabel122.TextColor3 = Color3.new(1, 1, 1)
  3275. TextLabel122.TextSize = 28
  3276. TextLabel122.TextXAlignment = Enum.TextXAlignment.Right
  3277. Frame123.Name = "Divider"
  3278. Frame123.Parent = Frame120
  3279. Frame123.Position = UDim2.new(0, 0, 1, 0)
  3280. Frame123.Size = UDim2.new(1, 0, 0, 1)
  3281. Frame123.BackgroundColor = BrickColor.new("Sand red")
  3282. Frame123.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3283. Frame123.BorderSizePixel = 0
  3284. Frame124.Name = "Control02"
  3285. Frame124.Parent = Frame119
  3286. Frame124.Position = UDim2.new(0, 0, 0, 30)
  3287. Frame124.Size = UDim2.new(1, 0, 0, 30)
  3288. Frame124.BackgroundColor = BrickColor.new("Institutional white")
  3289. Frame124.BackgroundColor3 = Color3.new(1, 1, 1)
  3290. Frame124.BackgroundTransparency = 1
  3291. TextLabel125.Name = "Label"
  3292. TextLabel125.Parent = Frame124
  3293. TextLabel125.Size = UDim2.new(1, 0, 1, 0)
  3294. TextLabel125.BackgroundColor = BrickColor.new("Institutional white")
  3295. TextLabel125.BackgroundColor3 = Color3.new(1, 1, 1)
  3296. TextLabel125.BackgroundTransparency = 1
  3297. TextLabel125.Font = Enum.Font.SourceSans
  3298. TextLabel125.FontSize = Enum.FontSize.Size28
  3299. TextLabel125.Text = "Yaw (Rudder)"
  3300. TextLabel125.TextColor = BrickColor.new("Institutional white")
  3301. TextLabel125.TextColor3 = Color3.new(1, 1, 1)
  3302. TextLabel125.TextSize = 28
  3303. TextLabel125.TextXAlignment = Enum.TextXAlignment.Left
  3304. TextLabel126.Name = "Control"
  3305. TextLabel126.Parent = Frame124
  3306. TextLabel126.Size = UDim2.new(1, 0, 1, 0)
  3307. TextLabel126.BackgroundColor = BrickColor.new("Institutional white")
  3308. TextLabel126.BackgroundColor3 = Color3.new(1, 1, 1)
  3309. TextLabel126.BackgroundTransparency = 1
  3310. TextLabel126.Font = Enum.Font.SourceSans
  3311. TextLabel126.FontSize = Enum.FontSize.Size28
  3312. TextLabel126.Text = "Q & E"
  3313. TextLabel126.TextColor = BrickColor.new("Institutional white")
  3314. TextLabel126.TextColor3 = Color3.new(1, 1, 1)
  3315. TextLabel126.TextSize = 28
  3316. TextLabel126.TextXAlignment = Enum.TextXAlignment.Right
  3317. Frame127.Name = "Divider"
  3318. Frame127.Parent = Frame124
  3319. Frame127.Position = UDim2.new(0, 0, 1, 0)
  3320. Frame127.Size = UDim2.new(1, 0, 0, 1)
  3321. Frame127.BackgroundColor = BrickColor.new("Sand red")
  3322. Frame127.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3323. Frame127.BorderSizePixel = 0
  3324. Frame128.Name = "Control03"
  3325. Frame128.Parent = Frame119
  3326. Frame128.Position = UDim2.new(0, 0, 0, 60)
  3327. Frame128.Size = UDim2.new(1, 0, 0, 30)
  3328. Frame128.BackgroundColor = BrickColor.new("Institutional white")
  3329. Frame128.BackgroundColor3 = Color3.new(1, 1, 1)
  3330. Frame128.BackgroundTransparency = 1
  3331. TextLabel129.Name = "Label"
  3332. TextLabel129.Parent = Frame128
  3333. TextLabel129.Size = UDim2.new(1, 0, 1, 0)
  3334. TextLabel129.BackgroundColor = BrickColor.new("Institutional white")
  3335. TextLabel129.BackgroundColor3 = Color3.new(1, 1, 1)
  3336. TextLabel129.BackgroundTransparency = 1
  3337. TextLabel129.Font = Enum.Font.SourceSans
  3338. TextLabel129.FontSize = Enum.FontSize.Size28
  3339. TextLabel129.Text = "Throttle"
  3340. TextLabel129.TextColor = BrickColor.new("Institutional white")
  3341. TextLabel129.TextColor3 = Color3.new(1, 1, 1)
  3342. TextLabel129.TextSize = 28
  3343. TextLabel129.TextXAlignment = Enum.TextXAlignment.Left
  3344. TextLabel130.Name = "Control"
  3345. TextLabel130.Parent = Frame128
  3346. TextLabel130.Size = UDim2.new(1, 0, 1, 0)
  3347. TextLabel130.BackgroundColor = BrickColor.new("Institutional white")
  3348. TextLabel130.BackgroundColor3 = Color3.new(1, 1, 1)
  3349. TextLabel130.BackgroundTransparency = 1
  3350. TextLabel130.Font = Enum.Font.SourceSans
  3351. TextLabel130.FontSize = Enum.FontSize.Size28
  3352. TextLabel130.Text = "Z & X"
  3353. TextLabel130.TextColor = BrickColor.new("Institutional white")
  3354. TextLabel130.TextColor3 = Color3.new(1, 1, 1)
  3355. TextLabel130.TextSize = 28
  3356. TextLabel130.TextXAlignment = Enum.TextXAlignment.Right
  3357. Frame131.Name = "Divider"
  3358. Frame131.Parent = Frame128
  3359. Frame131.Position = UDim2.new(0, 0, 1, 0)
  3360. Frame131.Size = UDim2.new(1, 0, 0, 1)
  3361. Frame131.BackgroundColor = BrickColor.new("Sand red")
  3362. Frame131.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3363. Frame131.BorderSizePixel = 0
  3364. Frame132.Name = "Control04"
  3365. Frame132.Parent = Frame119
  3366. Frame132.Position = UDim2.new(0, 0, 0, 90)
  3367. Frame132.Size = UDim2.new(1, 0, 0, 30)
  3368. Frame132.BackgroundColor = BrickColor.new("Institutional white")
  3369. Frame132.BackgroundColor3 = Color3.new(1, 1, 1)
  3370. Frame132.BackgroundTransparency = 1
  3371. TextLabel133.Name = "Label"
  3372. TextLabel133.Parent = Frame132
  3373. TextLabel133.Size = UDim2.new(1, 0, 1, 0)
  3374. TextLabel133.BackgroundColor = BrickColor.new("Institutional white")
  3375. TextLabel133.BackgroundColor3 = Color3.new(1, 1, 1)
  3376. TextLabel133.BackgroundTransparency = 1
  3377. TextLabel133.Font = Enum.Font.SourceSans
  3378. TextLabel133.FontSize = Enum.FontSize.Size28
  3379. TextLabel133.Text = "Camera View"
  3380. TextLabel133.TextColor = BrickColor.new("Institutional white")
  3381. TextLabel133.TextColor3 = Color3.new(1, 1, 1)
  3382. TextLabel133.TextSize = 28
  3383. TextLabel133.TextXAlignment = Enum.TextXAlignment.Left
  3384. TextLabel134.Name = "Control"
  3385. TextLabel134.Parent = Frame132
  3386. TextLabel134.Size = UDim2.new(1, 0, 1, 0)
  3387. TextLabel134.BackgroundColor = BrickColor.new("Institutional white")
  3388. TextLabel134.BackgroundColor3 = Color3.new(1, 1, 1)
  3389. TextLabel134.BackgroundTransparency = 1
  3390. TextLabel134.Font = Enum.Font.SourceSans
  3391. TextLabel134.FontSize = Enum.FontSize.Size28
  3392. TextLabel134.Text = "C"
  3393. TextLabel134.TextColor = BrickColor.new("Institutional white")
  3394. TextLabel134.TextColor3 = Color3.new(1, 1, 1)
  3395. TextLabel134.TextSize = 28
  3396. TextLabel134.TextXAlignment = Enum.TextXAlignment.Right
  3397. Frame135.Name = "Divider"
  3398. Frame135.Parent = Frame132
  3399. Frame135.Position = UDim2.new(0, 0, 1, 0)
  3400. Frame135.Size = UDim2.new(1, 0, 0, 1)
  3401. Frame135.BackgroundColor = BrickColor.new("Sand red")
  3402. Frame135.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3403. Frame135.BorderSizePixel = 0
  3404. Frame136.Name = "InvertSwitch"
  3405. Frame136.Parent = Frame94
  3406. Frame136.Position = UDim2.new(0, 10, 1, -60)
  3407. Frame136.Size = UDim2.new(1, -20, 0, -40)
  3408. Frame136.BackgroundColor = BrickColor.new("Institutional white")
  3409. Frame136.BackgroundColor3 = Color3.new(1, 1, 1)
  3410. Frame136.BackgroundTransparency = 1
  3411. TextLabel137.Name = "Label"
  3412. TextLabel137.Parent = Frame136
  3413. TextLabel137.Size = UDim2.new(1, 0, 1, 0)
  3414. TextLabel137.BackgroundColor = BrickColor.new("Institutional white")
  3415. TextLabel137.BackgroundColor3 = Color3.new(1, 1, 1)
  3416. TextLabel137.BackgroundTransparency = 1
  3417. TextLabel137.Font = Enum.Font.SourceSans
  3418. TextLabel137.FontSize = Enum.FontSize.Size24
  3419. TextLabel137.Text = "Invert Pitch:"
  3420. TextLabel137.TextColor = BrickColor.new("Institutional white")
  3421. TextLabel137.TextColor3 = Color3.new(1, 1, 1)
  3422. TextLabel137.TextSize = 24
  3423. TextLabel137.TextXAlignment = Enum.TextXAlignment.Left
  3424. TextButton138.Name = "Switch"
  3425. TextButton138.Parent = Frame136
  3426. TextButton138.Position = UDim2.new(1, 0, 0, 0)
  3427. TextButton138.Size = UDim2.new(-0.5, 0, 1, 0)
  3428. TextButton138.BackgroundColor = BrickColor.new("Institutional white")
  3429. TextButton138.BackgroundColor3 = Color3.new(1, 1, 1)
  3430. TextButton138.BorderSizePixel = 0
  3431. TextButton138.Font = Enum.Font.SourceSans
  3432. TextButton138.FontSize = Enum.FontSize.Size14
  3433. TextButton138.Text = ""
  3434. TextButton138.TextSize = 14
  3435. TextButton138.TextTransparency = 1
  3436. Frame139.Name = "Slider"
  3437. Frame139.Parent = TextButton138
  3438. Frame139.Position = UDim2.new(0.5, 0, 0, 0)
  3439. Frame139.Size = UDim2.new(0.5, 0, 1, 0)
  3440. Frame139.BackgroundColor = BrickColor.new("Institutional white")
  3441. Frame139.BackgroundColor3 = Color3.new(1, 1, 1)
  3442. Frame139.BackgroundTransparency = 1
  3443. Frame139.BorderSizePixel = 0
  3444. TextLabel140.Name = "Label"
  3445. TextLabel140.Parent = Frame139
  3446. TextLabel140.Position = UDim2.new(0, 5, 0, 5)
  3447. TextLabel140.Size = UDim2.new(1, -10, 1, -10)
  3448. TextLabel140.BackgroundColor = BrickColor.new("Sand red")
  3449. TextLabel140.BackgroundColor3 = Color3.new(0.470588, 0.470588, 0.470588)
  3450. TextLabel140.BorderSizePixel = 0
  3451. TextLabel140.Font = Enum.Font.SourceSansBold
  3452. TextLabel140.FontSize = Enum.FontSize.Size24
  3453. TextLabel140.Text = "NO"
  3454. TextLabel140.TextColor = BrickColor.new("Institutional white")
  3455. TextLabel140.TextColor3 = Color3.new(1, 1, 1)
  3456. TextLabel140.TextSize = 24
  3457. ScreenGui141.Name = "PlaneMobileGui"
  3458. ScreenGui141.Parent = LocalScript50
  3459. Frame142.Name = "Throttle"
  3460. Frame142.Parent = ScreenGui141
  3461. Frame142.Position = UDim2.new(0.5, 0, 1, -90)
  3462. Frame142.Size = UDim2.new(0, 200, 0, -10)
  3463. Frame142.AnchorPoint = Vector2.new(0.5, 0)
  3464. Frame142.BackgroundColor = BrickColor.new("Black")
  3465. Frame142.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3466. Frame142.BackgroundTransparency = 0.5
  3467. Frame142.BorderSizePixel = 0
  3468. TextLabel143.Name = "Label"
  3469. TextLabel143.Parent = Frame142
  3470. TextLabel143.Position = UDim2.new(0, 0, 0, -13)
  3471. TextLabel143.Size = UDim2.new(1, 0, 0, -20)
  3472. TextLabel143.BackgroundColor = BrickColor.new("Institutional white")
  3473. TextLabel143.BackgroundColor3 = Color3.new(1, 1, 1)
  3474. TextLabel143.BackgroundTransparency = 1
  3475. TextLabel143.Font = Enum.Font.SourceSansBold
  3476. TextLabel143.FontSize = Enum.FontSize.Size24
  3477. TextLabel143.Text = "THROTTLE"
  3478. TextLabel143.TextColor = BrickColor.new("Institutional white")
  3479. TextLabel143.TextColor3 = Color3.new(1, 1, 1)
  3480. TextLabel143.TextSize = 24
  3481. TextLabel143.TextStrokeTransparency = 0.80000001192093
  3482. Frame144.Name = "Knob"
  3483. Frame144.Parent = Frame142
  3484. Frame144.Position = UDim2.new(0, 0, 0.5, -15)
  3485. Frame144.Size = UDim2.new(0, 20, 0, 30)
  3486. Frame144.BackgroundColor = BrickColor.new("Institutional white")
  3487. Frame144.BackgroundColor3 = Color3.new(1, 1, 1)
  3488. Frame144.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3489. Frame144.BorderSizePixel = 2
  3490. Frame144.ZIndex = 2
  3491. Frame145.Name = "Bar"
  3492. Frame145.Parent = Frame142
  3493. Frame145.Size = UDim2.new(0, 0, 1, 0)
  3494. Frame145.BackgroundColor = BrickColor.new("Institutional white")
  3495. Frame145.BackgroundColor3 = Color3.new(1, 1, 1)
  3496. Frame145.BorderColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3497. Frame145.BorderSizePixel = 2
  3498. TextButton146.Name = "Grab"
  3499. TextButton146.Parent = Frame142
  3500. TextButton146.Position = UDim2.new(0, -10, 0, -15)
  3501. TextButton146.Size = UDim2.new(1, 20, 1, 30)
  3502. TextButton146.BackgroundColor = BrickColor.new("Really red")
  3503. TextButton146.BackgroundColor3 = Color3.new(1, 0, 0)
  3504. TextButton146.BackgroundTransparency = 1
  3505. TextButton146.ZIndex = 3
  3506. TextButton146.Font = Enum.Font.SourceSans
  3507. TextButton146.FontSize = Enum.FontSize.Size14
  3508. TextButton146.Text = ""
  3509. TextButton146.TextSize = 14
  3510. Frame147.Name = "Speed"
  3511. Frame147.Parent = ScreenGui141
  3512. Frame147.Position = UDim2.new(0.5, -10, 1, -20)
  3513. Frame147.Size = UDim2.new(0, 100, 0, -30)
  3514. Frame147.AnchorPoint = Vector2.new(1, 0)
  3515. Frame147.BackgroundColor = BrickColor.new("Black")
  3516. Frame147.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3517. Frame147.BackgroundTransparency = 0.5
  3518. Frame147.BorderSizePixel = 0
  3519. TextLabel148.Name = "Label"
  3520. TextLabel148.Parent = Frame147
  3521. TextLabel148.Position = UDim2.new(0, 0, 0, -3)
  3522. TextLabel148.Size = UDim2.new(1, 0, 0, -20)
  3523. TextLabel148.BackgroundColor = BrickColor.new("Institutional white")
  3524. TextLabel148.BackgroundColor3 = Color3.new(1, 1, 1)
  3525. TextLabel148.BackgroundTransparency = 1
  3526. TextLabel148.Font = Enum.Font.SourceSansBold
  3527. TextLabel148.FontSize = Enum.FontSize.Size24
  3528. TextLabel148.Text = "SPEED"
  3529. TextLabel148.TextColor = BrickColor.new("Institutional white")
  3530. TextLabel148.TextColor3 = Color3.new(1, 1, 1)
  3531. TextLabel148.TextSize = 24
  3532. TextLabel148.TextStrokeTransparency = 0.80000001192093
  3533. TextLabel149.Name = "Amount"
  3534. TextLabel149.Parent = Frame147
  3535. TextLabel149.Size = UDim2.new(1, 0, 1, 0)
  3536. TextLabel149.BackgroundColor = BrickColor.new("Institutional white")
  3537. TextLabel149.BackgroundColor3 = Color3.new(1, 1, 1)
  3538. TextLabel149.BackgroundTransparency = 1
  3539. TextLabel149.Font = Enum.Font.Code
  3540. TextLabel149.FontSize = Enum.FontSize.Size14
  3541. TextLabel149.Text = "0"
  3542. TextLabel149.TextColor = BrickColor.new("Institutional white")
  3543. TextLabel149.TextColor3 = Color3.new(1, 1, 1)
  3544. TextLabel149.TextScaled = true
  3545. TextLabel149.TextSize = 14
  3546. TextLabel149.TextWrap = true
  3547. TextLabel149.TextWrapped = true
  3548. Frame150.Name = "Altitude"
  3549. Frame150.Parent = ScreenGui141
  3550. Frame150.Position = UDim2.new(0.5, 10, 1, -20)
  3551. Frame150.Size = UDim2.new(0, 100, 0, -30)
  3552. Frame150.BackgroundColor = BrickColor.new("Black")
  3553. Frame150.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3554. Frame150.BackgroundTransparency = 0.5
  3555. Frame150.BorderSizePixel = 0
  3556. TextLabel151.Name = "Label"
  3557. TextLabel151.Parent = Frame150
  3558. TextLabel151.Position = UDim2.new(0, 0, 0, -3)
  3559. TextLabel151.Size = UDim2.new(1, 0, 0, -20)
  3560. TextLabel151.BackgroundColor = BrickColor.new("Institutional white")
  3561. TextLabel151.BackgroundColor3 = Color3.new(1, 1, 1)
  3562. TextLabel151.BackgroundTransparency = 1
  3563. TextLabel151.Font = Enum.Font.SourceSansBold
  3564. TextLabel151.FontSize = Enum.FontSize.Size24
  3565. TextLabel151.Text = "ALTITUDE"
  3566. TextLabel151.TextColor = BrickColor.new("Institutional white")
  3567. TextLabel151.TextColor3 = Color3.new(1, 1, 1)
  3568. TextLabel151.TextSize = 24
  3569. TextLabel151.TextStrokeTransparency = 0.80000001192093
  3570. TextLabel152.Name = "Amount"
  3571. TextLabel152.Parent = Frame150
  3572. TextLabel152.Size = UDim2.new(1, 0, 1, 0)
  3573. TextLabel152.BackgroundColor = BrickColor.new("Institutional white")
  3574. TextLabel152.BackgroundColor3 = Color3.new(1, 1, 1)
  3575. TextLabel152.BackgroundTransparency = 1
  3576. TextLabel152.Font = Enum.Font.Code
  3577. TextLabel152.FontSize = Enum.FontSize.Size14
  3578. TextLabel152.Text = "0"
  3579. TextLabel152.TextColor = BrickColor.new("Institutional white")
  3580. TextLabel152.TextColor3 = Color3.new(1, 1, 1)
  3581. TextLabel152.TextScaled = true
  3582. TextLabel152.TextSize = 14
  3583. TextLabel152.TextWrap = true
  3584. TextLabel152.TextWrapped = true
  3585. ModuleScript153.Name = "GuiController"
  3586. ModuleScript153.Parent = ScreenGui141
  3587. table.insert(cors,sandbox(ModuleScript153,function()
  3588. -- Gui Controller (For mobile)
  3589. -- Crazyman32
  3590. -- January 26, 2017
  3591.  
  3592.  
  3593.  
  3594. local GuiController = {
  3595. Throttle = 0;
  3596. Bank = 0;
  3597. Pitch = 0;
  3598. Yaw = 0;
  3599. ViewX = 0;
  3600. ViewY = 0;
  3601. SwitchView = false;
  3602. Exit = false;
  3603. }
  3604.  
  3605.  
  3606. -- Mobile controls are sensitive! Control inputs are multiplied by
  3607. -- this number to help make flying a bit easier on mobile:
  3608. local CONTROL_INPUT_REDUCTION = 0.5
  3609.  
  3610. local VIEW_PAN_MULTIPLIER = 0.005
  3611.  
  3612. local userInput = game:GetService("UserInputService")
  3613.  
  3614.  
  3615. local gui = script.Parent
  3616. local plane
  3617. local primary
  3618.  
  3619. local spd, alt
  3620.  
  3621. function ThrottleSetup()
  3622.  
  3623. local throttle = gui:WaitForChild("Throttle")
  3624. local grab = throttle:WaitForChild("Grab")
  3625. local bar = throttle:WaitForChild("Bar")
  3626. local knob = throttle:WaitForChild("Knob")
  3627.  
  3628. local grabPos = grab.Position
  3629. local grabSize = grab.Size
  3630.  
  3631. local grabDown = false
  3632.  
  3633. grab.InputChanged:Connect(function(input)
  3634. if (grabDown and input.UserInputType == Enum.UserInputType.Touch) then
  3635. local x = input.Position.X
  3636. local xRatio = (x - throttle.AbsolutePosition.X) / throttle.AbsoluteSize.X
  3637. xRatio = (xRatio < 0 and 0 or xRatio > 1 and 1 or xRatio)
  3638. GuiController.Throttle = xRatio
  3639. bar.Size = UDim2.new(xRatio, 0, 1, 0)
  3640. knob.Position = UDim2.new(xRatio, -knob.AbsoluteSize.X * xRatio, 0.5, -15)
  3641. end
  3642. end)
  3643.  
  3644. grab.MouseButton1Down:Connect(function()
  3645. grabDown = true
  3646. end)
  3647.  
  3648. userInput.InputEnded:Connect(function(input)
  3649. if (input.UserInputType == Enum.UserInputType.Touch) then
  3650. grabDown = false
  3651. end
  3652. end)
  3653.  
  3654. end
  3655.  
  3656.  
  3657. -- Set up an on-screen thumbstick control:
  3658. function ThumbstickSetup(frame, callback)
  3659.  
  3660. local stick = frame:WaitForChild("Stick")
  3661. local btn = frame:WaitForChild("Button")
  3662.  
  3663. local btnDown = false
  3664.  
  3665. -- Calculate relative position of thumbstick when dragged to screen position "pos":
  3666. local function TouchDragged(pos)
  3667. local x = (pos.X - frame.AbsolutePosition.X)
  3668. local y = (pos.Y - frame.AbsolutePosition.Y)
  3669. x = (x < 0 and 0 or x > frame.AbsoluteSize.X and frame.AbsoluteSize.X or x)
  3670. y = (y < 0 and 0 or y > frame.AbsoluteSize.Y and frame.AbsoluteSize.Y or y)
  3671. local ratioX = ((x / frame.AbsoluteSize.X) - 0.5) * 2
  3672. local ratioY = -((y / frame.AbsoluteSize.Y) - 0.5) * 2
  3673. stick.Position = UDim2.new(0, x, 0, y)
  3674. callback(ratioX, ratioY)
  3675. end
  3676.  
  3677. local function StartTouch(pos)
  3678. btnDown = true
  3679. TouchDragged(pos)
  3680. btn.Size = UDim2.new(10, 0, 10, 0)
  3681. end
  3682.  
  3683. local function StopTouch(pos)
  3684. btnDown = false
  3685. stick:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quint", 0.15, true)
  3686. btn.Size = UDim2.new(1, 0, 1, 0)
  3687. callback(0, 0)
  3688. end
  3689.  
  3690. btn.InputChanged:Connect(function(input)
  3691. if (btnDown and input.UserInputType == Enum.UserInputType.Touch) then
  3692. TouchDragged(input.Position)
  3693. end
  3694. end)
  3695.  
  3696. btn.MouseButton1Down:Connect(function(x, y)
  3697. StartTouch(Vector3.new(x, y, 0))
  3698. end)
  3699.  
  3700. btn.InputEnded:Connect(function(input)
  3701. if (input.UserInputType == Enum.UserInputType.Touch) then
  3702. StopTouch(input.Position)
  3703. end
  3704. end)
  3705.  
  3706. end
  3707.  
  3708.  
  3709. function GuiController:Update()
  3710. spd.Text = tostring(math.floor(primary.Velocity.Magnitude))
  3711. alt.Text = tostring(math.floor(primary.Position.Y))
  3712. end
  3713.  
  3714.  
  3715. function GuiController:Start(p)
  3716.  
  3717. plane = p
  3718. primary = plane.PrimaryPart
  3719. ThrottleSetup()
  3720. spd = gui:WaitForChild("Speed"):WaitForChild("Amount")
  3721. alt = gui:WaitForChild("Altitude"):WaitForChild("Amount")
  3722.  
  3723. local touchingScreen = false
  3724. local lastTouchPos
  3725.  
  3726. -- Yaw thumbstick:
  3727. ThumbstickSetup(gui:WaitForChild("ThumbstickLeft"), function(x, y)
  3728. self.Yaw = x
  3729. end)
  3730.  
  3731. -- Maneuver thumbstick:
  3732. ThumbstickSetup(gui:WaitForChild("ThumbstickRight"), function(x, y)
  3733. self.Bank = x * CONTROL_INPUT_REDUCTION
  3734. self.Pitch = y * CONTROL_INPUT_REDUCTION
  3735. end)
  3736.  
  3737. -- Pan view when dragging finger across screen:
  3738. userInput.TouchMoved:Connect(function(inputObject, processed)
  3739. if (not touchingScreen) then return end
  3740. local pos = inputObject.Position
  3741. local deltaPos = (pos - lastTouchPos)
  3742. local x = (self.ViewX - (deltaPos.X * VIEW_PAN_MULTIPLIER))
  3743. local y = (self.ViewY - (deltaPos.Y * VIEW_PAN_MULTIPLIER))
  3744. self.ViewX = (x < -1 and -1 or x > 1 and 1 or x)
  3745. self.ViewY = (y < -1 and -1 or y > 1 and 1 or y)
  3746. lastTouchPos = pos
  3747. end)
  3748.  
  3749. -- Start panning:
  3750. userInput.TouchStarted:Connect(function(inputObject, processed)
  3751. if (processed) then return end
  3752. touchingScreen = true
  3753. lastTouchPos = inputObject.Position
  3754. end)
  3755.  
  3756. -- Stop panning:
  3757. userInput.TouchEnded:Connect(function(inputObject, processed)
  3758. touchingScreen = false
  3759. end)
  3760.  
  3761. -- Change view:
  3762. gui:WaitForChild("ChangeView").MouseButton1Click:Connect(function()
  3763. self.SwitchView = true
  3764. end)
  3765.  
  3766. -- Exit plane:
  3767. gui:WaitForChild("Exit").MouseButton1Click:Connect(function()
  3768. self.Exit = true
  3769. end)
  3770.  
  3771. end
  3772.  
  3773.  
  3774. function GuiController:Stop()
  3775.  
  3776. end
  3777.  
  3778.  
  3779. return GuiController
  3780. end))
  3781. Frame154.Name = "ThumbstickLeft"
  3782. Frame154.Parent = ScreenGui141
  3783. Frame154.Position = UDim2.new(0, 20, 1, -140)
  3784. Frame154.Size = UDim2.new(0, 120, 0, 120)
  3785. Frame154.BackgroundColor = BrickColor.new("Black")
  3786. Frame154.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3787. Frame154.BackgroundTransparency = 0.5
  3788. Frame155.Name = "Stick"
  3789. Frame155.Parent = Frame154
  3790. Frame155.Position = UDim2.new(0.5, 0, 0.5, 0)
  3791. Frame155.Size = UDim2.new(0.300000012, 0, 0.300000012, 0)
  3792. Frame155.AnchorPoint = Vector2.new(0.5, 0.5)
  3793. Frame155.BackgroundColor = BrickColor.new("Institutional white")
  3794. Frame155.BackgroundColor3 = Color3.new(1, 1, 1)
  3795. Frame155.BorderSizePixel = 0
  3796. TextButton156.Name = "Button"
  3797. TextButton156.Parent = Frame154
  3798. TextButton156.Position = UDim2.new(0.5, 0, 0.5, 0)
  3799. TextButton156.Size = UDim2.new(1, 0, 1, 0)
  3800. TextButton156.AnchorPoint = Vector2.new(0.5, 0.5)
  3801. TextButton156.BackgroundColor = BrickColor.new("Institutional white")
  3802. TextButton156.BackgroundColor3 = Color3.new(1, 1, 1)
  3803. TextButton156.BackgroundTransparency = 1
  3804. TextButton156.Font = Enum.Font.SourceSans
  3805. TextButton156.FontSize = Enum.FontSize.Size14
  3806. TextButton156.Text = ""
  3807. TextButton156.TextSize = 14
  3808. TextButton156.TextTransparency = 1
  3809. TextLabel157.Name = "Label"
  3810. TextLabel157.Parent = Frame154
  3811. TextLabel157.Position = UDim2.new(0, 0, 0, -3)
  3812. TextLabel157.Size = UDim2.new(1, 0, 0, -20)
  3813. TextLabel157.BackgroundColor = BrickColor.new("Institutional white")
  3814. TextLabel157.BackgroundColor3 = Color3.new(1, 1, 1)
  3815. TextLabel157.BackgroundTransparency = 1
  3816. TextLabel157.Font = Enum.Font.SourceSansBold
  3817. TextLabel157.FontSize = Enum.FontSize.Size24
  3818. TextLabel157.Text = "YAW"
  3819. TextLabel157.TextColor = BrickColor.new("Institutional white")
  3820. TextLabel157.TextColor3 = Color3.new(1, 1, 1)
  3821. TextLabel157.TextSize = 24
  3822. TextLabel157.TextStrokeTransparency = 0.80000001192093
  3823. Frame158.Name = "ThumbstickRight"
  3824. Frame158.Parent = ScreenGui141
  3825. Frame158.Position = UDim2.new(1, -140, 1, -140)
  3826. Frame158.Size = UDim2.new(0, 120, 0, 120)
  3827. Frame158.BackgroundColor = BrickColor.new("Black")
  3828. Frame158.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3829. Frame158.BackgroundTransparency = 0.5
  3830. Frame159.Name = "Stick"
  3831. Frame159.Parent = Frame158
  3832. Frame159.Position = UDim2.new(0.5, 0, 0.5, 0)
  3833. Frame159.Size = UDim2.new(0.300000012, 0, 0.300000012, 0)
  3834. Frame159.AnchorPoint = Vector2.new(0.5, 0.5)
  3835. Frame159.BackgroundColor = BrickColor.new("Institutional white")
  3836. Frame159.BackgroundColor3 = Color3.new(1, 1, 1)
  3837. Frame159.BorderSizePixel = 0
  3838. TextButton160.Name = "Button"
  3839. TextButton160.Parent = Frame158
  3840. TextButton160.Position = UDim2.new(0.5, 0, 0.5, 0)
  3841. TextButton160.Size = UDim2.new(1, 0, 1, 0)
  3842. TextButton160.AnchorPoint = Vector2.new(0.5, 0.5)
  3843. TextButton160.BackgroundColor = BrickColor.new("Institutional white")
  3844. TextButton160.BackgroundColor3 = Color3.new(1, 1, 1)
  3845. TextButton160.BackgroundTransparency = 1
  3846. TextButton160.Font = Enum.Font.SourceSans
  3847. TextButton160.FontSize = Enum.FontSize.Size14
  3848. TextButton160.Text = ""
  3849. TextButton160.TextSize = 14
  3850. TextButton160.TextTransparency = 1
  3851. TextLabel161.Name = "Label"
  3852. TextLabel161.Parent = Frame158
  3853. TextLabel161.Position = UDim2.new(0, 0, 0, -3)
  3854. TextLabel161.Size = UDim2.new(1, 0, 0, -20)
  3855. TextLabel161.BackgroundColor = BrickColor.new("Institutional white")
  3856. TextLabel161.BackgroundColor3 = Color3.new(1, 1, 1)
  3857. TextLabel161.BackgroundTransparency = 1
  3858. TextLabel161.Font = Enum.Font.SourceSansBold
  3859. TextLabel161.FontSize = Enum.FontSize.Size24
  3860. TextLabel161.Text = "PITCH & ROLL"
  3861. TextLabel161.TextColor = BrickColor.new("Institutional white")
  3862. TextLabel161.TextColor3 = Color3.new(1, 1, 1)
  3863. TextLabel161.TextSize = 24
  3864. TextLabel161.TextStrokeTransparency = 0.80000001192093
  3865. TextButton162.Name = "ChangeView"
  3866. TextButton162.Parent = ScreenGui141
  3867. TextButton162.Position = UDim2.new(1, -20, 1, -180)
  3868. TextButton162.Size = UDim2.new(0, -120, 0, -40)
  3869. TextButton162.BackgroundColor = BrickColor.new("Institutional white")
  3870. TextButton162.BackgroundColor3 = Color3.new(1, 1, 1)
  3871. TextButton162.BackgroundTransparency = 0.5
  3872. TextButton162.BorderSizePixel = 0
  3873. TextButton162.Font = Enum.Font.SourceSans
  3874. TextButton162.FontSize = Enum.FontSize.Size14
  3875. TextButton162.Text = "VIEW"
  3876. TextButton162.TextColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3877. TextButton162.TextScaled = true
  3878. TextButton162.TextSize = 14
  3879. TextButton162.TextWrap = true
  3880. TextButton162.TextWrapped = true
  3881. TextButton163.Name = "Exit"
  3882. TextButton163.Parent = ScreenGui141
  3883. TextButton163.Position = UDim2.new(1, -20, 0, 20)
  3884. TextButton163.Size = UDim2.new(0, -120, 0, 40)
  3885. TextButton163.BackgroundColor = BrickColor.new("Institutional white")
  3886. TextButton163.BackgroundColor3 = Color3.new(1, 1, 1)
  3887. TextButton163.BackgroundTransparency = 0.5
  3888. TextButton163.BorderSizePixel = 0
  3889. TextButton163.Font = Enum.Font.SourceSans
  3890. TextButton163.FontSize = Enum.FontSize.Size14
  3891. TextButton163.Text = "EXIT"
  3892. TextButton163.TextColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  3893. TextButton163.TextScaled = true
  3894. TextButton163.TextSize = 14
  3895. TextButton163.TextWrap = true
  3896. TextButton163.TextWrapped = true
  3897. BoolValue164.Name = "ReadyToWeld"
  3898. BoolValue164.Parent = Model1
  3899. Script165.Name = "Damage"
  3900. Script165.Parent = Model1
  3901. table.insert(cors,sandbox(Script165,function()
  3902. -- Damage
  3903. -- Crazyman32
  3904. -- January 19, 2017
  3905.  
  3906. --[[
  3907.  
  3908. This script handles simulating damage on the aircraft by
  3909. listening to objects that touch the aircraft. By measuring
  3910. the impact velocity (plane's velocity - other velocity),
  3911. we can try to subtract health from the plane. If the health
  3912. hits 0, the plane dies!
  3913.  
  3914. To change the Max Health of the plane, change the MaxValue
  3915. of the Health object (it's a child of this script object).
  3916. The health will automatically be set to the MaxValue when
  3917. this script is executed.
  3918.  
  3919. --]]
  3920.  
  3921.  
  3922.  
  3923. local plane = script.Parent
  3924. while (not plane.PrimaryPart) do wait() end
  3925. local main = plane.PrimaryPart
  3926.  
  3927. local seat = plane:WaitForChild("Functional"):WaitForChild("PilotSeat")
  3928.  
  3929. local lookFor = "DamageCollider"
  3930.  
  3931. local health = script:WaitForChild("Health")
  3932. health.Value = health.MaxValue
  3933.  
  3934. -- Calculate damage when the magnitude of the
  3935. -- impact is within the range of these values:
  3936. local impactThresholdLow = 70
  3937. local impactThresholdHigh = 500
  3938.  
  3939. -- Maximum possible damage from a single impact: (In other words, if the impact hits "impactThresholdHigh", then this much damage is done)
  3940. local maxDamage = 300
  3941.  
  3942. -- Is it dead? (Don't change!)
  3943. local dead = false
  3944.  
  3945. -- When did it die? (Don't change!)
  3946. local deadAt = 0
  3947.  
  3948. -- Should the plane break into pieces next impact? (Don't change!)
  3949. local breakPlane = false
  3950.  
  3951. local listeners = {}
  3952.  
  3953.  
  3954. function KillPlane()
  3955. breakPlane = true
  3956. -- Kill the pilot:
  3957. if (seat.Occupant) then
  3958. seat.Occupant.Health = 0
  3959. -- Sorry pilot. Hopefully the game has respawning implemented.
  3960. end
  3961. main.Fire.Enabled = false
  3962. main.Smoke.Enabled = false
  3963. plane:BreakJoints()
  3964. -- Play explosion. BOOM:
  3965. if (main.Parent and main:FindFirstChild("Explosion")) then
  3966. main.Explosion:Play()
  3967. end
  3968. end
  3969.  
  3970.  
  3971. -- Listen for impact damage on the given part:
  3972. function ListenForDamage(part)
  3973.  
  3974. -- Classic debounce. If "true", then touches are "debounced", thus
  3975. -- any impacts when this is "true" will be ignored. It is only
  3976. -- set true for a fraction of a second after impacts:
  3977. local debounce = false
  3978.  
  3979. local listener = part.Touched:Connect(function(toucher)
  3980.  
  3981. if (debounce or toucher:IsDescendantOf(plane)) then return end
  3982.  
  3983. -- Measure impact force:
  3984. local impactVelocity = (part.Velocity - toucher.Velocity).Magnitude
  3985.  
  3986. if (impactVelocity > impactThresholdLow or dead) then
  3987. if (dead) then
  3988.  
  3989. -- How long it's been since the plane died and this impact occurred:
  3990. local dur = (tick() - deadAt)
  3991.  
  3992. -- My professor would yell at me for this "magic number".
  3993. -- Coding tip: Typically you shouldn't have random numbers floating around your code like this.
  3994. -- I'm going to not fix this just to teach you a lesson (and thanks for reading my crazy comments).
  3995. if (dur > 0.1 and not breakPlane) then
  3996. KillPlane()
  3997. end
  3998.  
  3999. else
  4000.  
  4001. -- Calculate how much damage should be done based on the impact thresholds and the max damage allowed per impact:
  4002. local damageRatio = (impactVelocity - impactThresholdLow) / (impactThresholdHigh - impactThresholdLow)
  4003. local damage = (maxDamage * damageRatio)
  4004. health.Value = (health.Value - damage)
  4005. debounce = true
  4006.  
  4007. -- Somewhat arbitrary delay (at least the amount of time is arbitrary).
  4008. -- Don't allow any other damage until this delay function executes:
  4009. delay(0.25, function()
  4010. debounce = false
  4011. end)
  4012.  
  4013. end
  4014. end
  4015. end)
  4016.  
  4017. -- Store the listener! We will want to disconnect it at some point:
  4018. table.insert(listeners, listener)
  4019.  
  4020. end
  4021.  
  4022.  
  4023. -- Called when the health reaches 0:
  4024. function OnDied()
  4025. dead = true
  4026. deadAt = tick()
  4027. plane.Dead.Value = true
  4028. main.Fire.Enabled = true
  4029. main.Smoke.Enabled = true
  4030. -- Wait a bit before forcing the plane to break into pieces:
  4031. delay(5, function()
  4032. if (not breakPlane) then
  4033. KillPlane()
  4034. end
  4035. -- Remove the plane after a little while:
  4036. wait(10)
  4037. plane:Destroy()
  4038. end)
  4039. end
  4040.  
  4041.  
  4042. -- Called when the health changes:
  4043. function HealthChanged(newHealth)
  4044. if (dead) then return end
  4045. if (newHealth <= health.MinValue) then
  4046. OnDied()
  4047. end
  4048. end
  4049.  
  4050.  
  4051. -- Recurse through the plane to find all the parts, then hook each
  4052. -- part up to listen for damage:
  4053. function ScanForParts(parent)
  4054. for _,v in pairs(parent:GetChildren()) do
  4055. if (v:IsA("BasePart") and v:FindFirstChild(lookFor)) then
  4056. ListenForDamage(v)
  4057. end
  4058. ScanForParts(v)
  4059. end
  4060. -- Fun fact: Recursive functions like this can be prone to "stack overflow" errors.
  4061. -- Tail-call functions would avoid this, but (as of Feb. 2017) tailcalling is removed from Lua in ROBLOX.
  4062. end
  4063.  
  4064. ScanForParts(plane)
  4065. health.Changed:Connect(HealthChanged)
  4066. HealthChanged(health.Value)
  4067. end))
  4068. DoubleConstrainedValue166.Name = "Health"
  4069. DoubleConstrainedValue166.Parent = Script165
  4070. DoubleConstrainedValue166.Value = 100
  4071. DoubleConstrainedValue166.ConstrainedValue = 100
  4072. DoubleConstrainedValue166.MaxValue = 100
  4073. BoolValue167.Name = "Dead"
  4074. BoolValue167.Parent = Model1
  4075. ModuleScript168.Name = "Flyer"
  4076. ModuleScript168.Parent = Model1
  4077. table.insert(cors,sandbox(ModuleScript168,function()
  4078. -- Flyer
  4079. -- Crazyman32
  4080. -- January 18, 2017
  4081.  
  4082. --[[
  4083.  
  4084. This module is used by the Server AND the Client to simulate
  4085. flight. This is sort-of the brain of the plane simulation,
  4086. although the actual physics are calculated in the AirFoil
  4087. module (a child of this module).
  4088.  
  4089. The purpose of this module is to continuously update the plane
  4090. air foils and engine based on input that is given to the plane.
  4091.  
  4092. This module also updates the weld animations.
  4093.  
  4094.  
  4095. Fields:
  4096.  
  4097. (All of these are numbers between 0-1)
  4098.  
  4099. Flyer.Throttle
  4100. Flyer.BankInput
  4101. Flyer.PitchInput
  4102. Flyer.YawInput
  4103.  
  4104. Methods:
  4105.  
  4106. Flyer:Update() Update the physics (airfoils and engine force)
  4107. Flyer:UpdateControls() Update input dampers and apply animations
  4108. Flyer:Stop() Stop airfoils
  4109. Flyer:Startup() Play startup sound and set initial throttle
  4110. Flyer:Shutdown() Play shutdown sound and stop other sounds
  4111. Flyer:ForceRealThrottle(t) Force the actual throttle (inputted Flyer.Throttle is damped; this bypasses damping)
  4112.  
  4113. --]]
  4114.  
  4115.  
  4116.  
  4117. local Flyer = {
  4118. Throttle = 0;
  4119. BankInput = 0;
  4120. PitchInput = 0;
  4121. YawInput = 0;
  4122. }
  4123.  
  4124. -- Max engine force and yaw force. Feel free to change these, but note
  4125. -- that changing these could make the plane unstable. But hey, experimenting
  4126. -- is fun! So try some different numbers. If the plane isn't taking off,
  4127. -- then the engine force is too low.
  4128. local MAX_ENGINE_FORCE = 300
  4129. local MAX_YAW_FORCE = 5
  4130.  
  4131.  
  4132. -- Note: Changing max rotation values below changes how much the control
  4133. -- surface rotates. Because the flight physics is literally based on the
  4134. -- orientation of those surfaces, it ALSO changes the magnitude in which
  4135. -- those surfaces act on the flight. For example, if you set MAX_BANK to
  4136. -- 0, then the plane won't rotate the ailerons, thus the plane can't bank.
  4137.  
  4138. -- Max rotation in degrees:
  4139. local MAX_BANK = 20
  4140. local MAX_PITCH = 25
  4141. local MAX_YAW = 15
  4142. local MAX_JOYSTICK = 20
  4143.  
  4144. -- Some commonly-used functions:
  4145. local V3 = Vector3.new
  4146. local RAD = math.rad
  4147. local ANG = CFrame.Angles
  4148.  
  4149. local AirFoil = require(script:WaitForChild("AirFoil"))
  4150. local Damping = require(script:WaitForChild("Damping"))
  4151.  
  4152. -- References to objects in the plane:
  4153. local plane = script.Parent
  4154. local functional = plane:WaitForChild("Functional")
  4155. local propeller = functional:WaitForChild("Propeller")
  4156. local tailSkid = functional:WaitForChild("TailSkid")
  4157.  
  4158. local tailSkidAttachment = Instance.new("Attachment",tailSkid)
  4159. local tailSkidThrust = Instance.new("VectorForce",tailSkid)
  4160. tailSkidThrust.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
  4161. tailSkidThrust.Attachment0 = tailSkidAttachment
  4162.  
  4163. local controlSurfaces = functional:WaitForChild("ControlSurfaces")
  4164. local staticAirFoils = functional:WaitForChild("StaticAirFoils")
  4165. local animWelds = plane:WaitForChild("Welds"):WaitForChild("AnimatedWelds")
  4166. local main = plane.PrimaryPart
  4167. local thruster = main:WaitForChild("VectorForce")
  4168.  
  4169. -- Engine sounds:
  4170. local sStartup = main:WaitForChild("Startup")
  4171. local sShutdown = main:WaitForChild("Shutdown")
  4172. local sIdle = main:WaitForChild("Idle")
  4173. local sLowThrottle = main:WaitForChild("LowThrottle")
  4174. local sFlying = main:WaitForChild("Flying")
  4175.  
  4176. -- Input dampers for silky-smooth animations:
  4177. local controlDamp = Damping.new()
  4178. local throttleDamp = Damping.new()
  4179. throttleDamp.P = 1
  4180. throttleDamp.D = 0.5
  4181.  
  4182. local realThrottle = 0
  4183. local realYaw = 0
  4184.  
  4185. -- Sound ranges (sorry for making this so confusing)
  4186. local soundRanges = {
  4187. -- {sound, min, max, max, min, minSpeed, maxSpeed}
  4188. {sIdle, 0.4, 0.5, 0.6, 0.8, 1.0, 2.0};
  4189. {sLowThrottle, 0.6, 0.7, 0.8, 0.9, 0.8, 1.5};
  4190. {sFlying, 0.7, 0.9, 1.0, 1.1, 0.8, 1.2};
  4191. }
  4192. local numSoundRanges = #soundRanges
  4193.  
  4194.  
  4195. -- Calculate the volume and speed of each sound. I apologize for making
  4196. -- this so confusing. It works how it should though.
  4197. local function CalcSounds(throttle)
  4198.  
  4199. for i = 1,numSoundRanges do
  4200.  
  4201. local ranges = soundRanges[i]
  4202. local s = ranges[1]
  4203.  
  4204. -- IF Throttle >= StartMinumum AND Throttle <= EndMaximum THEN
  4205. if (throttle >= ranges[2] and throttle <= ranges[5]) then
  4206.  
  4207. -- IF Throttle < StartMaximum THEN
  4208. if (throttle < ranges[3]) then
  4209. -- Tween in
  4210. s.Volume = (throttle - ranges[2]) / (ranges[3] - ranges[2])
  4211.  
  4212. -- IF Throttle > EndMinimum:
  4213. elseif (throttle > ranges[4]) then
  4214. -- Tween out
  4215. s.Volume = 1 - (throttle - ranges[4]) / (ranges[5] - ranges[4])
  4216.  
  4217. -- ELSE (Within full-range threshold):
  4218. else
  4219. s.Volume = 1
  4220. end
  4221.  
  4222. -- Calculate playback speed (i.e. pitch shifting):
  4223. local playbackRatio = (throttle - ranges[2]) / (ranges[5] - ranges[2])
  4224. s.PlaybackSpeed = (ranges[6] + ((ranges[7] - ranges[6]) * playbackRatio))
  4225.  
  4226. if (not s.IsPlaying) then
  4227. s:Play()
  4228. end
  4229.  
  4230. elseif (s.IsPlaying) then
  4231. s:Stop()
  4232. end
  4233.  
  4234. end
  4235. end
  4236.  
  4237. -- Get the mass of the airplane:
  4238. local mass = 0
  4239. do
  4240. local function Scan(parent)
  4241. for _,v in pairs(parent:GetChildren()) do
  4242. if (v:IsA("BasePart")) then
  4243. mass = (mass + v:GetMass())
  4244. end
  4245. Scan(v)
  4246. end
  4247. end
  4248. Scan(plane)
  4249. end
  4250.  
  4251. local airFoils = {}
  4252.  
  4253. -- Initialize air foils:
  4254. do
  4255.  
  4256. local function CreateAirFoil(parent, partName, overrideLift, overrideDrag)
  4257. local part = parent:WaitForChild(partName)
  4258. local airFoil = AirFoil.new(part, mass, overrideLift, overrideDrag)
  4259. table.insert(airFoils, airFoil)
  4260. end
  4261.  
  4262. -- NOTE: Some are commented out since the plane seemed more unstable with them implemented!
  4263.  
  4264. CreateAirFoil(controlSurfaces, "AileronBottomLeft")
  4265. CreateAirFoil(controlSurfaces, "AileronBottomRight")
  4266. --CreateAirFoil(controlSurfaces, "AileronTopLeft")
  4267. --CreateAirFoil(controlSurfaces, "AileronTopRight")
  4268. CreateAirFoil(controlSurfaces, "ElevatorLeft")
  4269. CreateAirFoil(controlSurfaces, "ElevatorRight")
  4270. --CreateAirFoil(controlSurfaces, "Rudder")
  4271. --CreateAirFoil(staticAirFoils, "WingBottomLeft")
  4272. --CreateAirFoil(staticAirFoils, "WingBottomRight")
  4273. CreateAirFoil(staticAirFoils, "WingTop")
  4274. CreateAirFoil(staticAirFoils, "HorizontalStabilizerLeft")
  4275. CreateAirFoil(staticAirFoils, "HorizontalStabilizerRight")
  4276. --CreateAirFoil(staticAirFoils, "VerticalStabilizer")
  4277.  
  4278. end
  4279.  
  4280.  
  4281. function Flyer:ForceRealThrottle(t)
  4282. realThrottle = t
  4283. self.Throttle = t
  4284. throttleDamp.Position = Vector3.new(t, 0, 0)
  4285. throttleDamp.Goal = throttleDamp.Position
  4286. end
  4287.  
  4288.  
  4289. --[[
  4290. function Flyer:UpdateSound()
  4291. CalcSounds(realThrottle)
  4292. end
  4293. ]]
  4294.  
  4295.  
  4296. -- Physics updates:
  4297. function Flyer:Update()
  4298. -- Update all airfoils:
  4299. for _,airFoil in pairs(airFoils) do
  4300. airFoil:Update()
  4301. end
  4302. -- Update main power/thrust:
  4303. local t = realThrottle
  4304. if (t > 0) then
  4305. t = math.max(0.05, (realThrottle - 0.5) * 2)
  4306. end
  4307. -- Apply engine thrust:
  4308. thruster.Force = V3(0, 0, t * mass * -MAX_ENGINE_FORCE)
  4309. -- Rotate tailskid:
  4310. tailSkidThrust.Force = V3(realYaw * mass * -MAX_YAW_FORCE, 0, 0)
  4311. -- Update sound:
  4312. --self:UpdateSound()
  4313. CalcSounds(realThrottle)
  4314. end
  4315.  
  4316. local lastControlUpdate = tick()
  4317.  
  4318. -- Update control surface animations:
  4319. function Flyer:UpdateControls()
  4320. local now = tick()
  4321. local dt = (now - lastControlUpdate)
  4322. lastControlUpdate = now
  4323. controlDamp.Goal = V3(self.BankInput, self.PitchInput, self.YawInput)
  4324. throttleDamp.Goal = V3(self.Throttle, 0, 0)
  4325. local controlInputs = controlDamp:Update()
  4326. local throttleInput = throttleDamp:Update()
  4327. realThrottle = throttleInput.X
  4328. local bank, pitch, yaw = controlInputs.X, controlInputs.Y, controlInputs.Z
  4329. bank = RAD(bank * MAX_BANK)
  4330. pitch = RAD(pitch * MAX_PITCH)
  4331. realYaw = yaw
  4332. yaw = RAD(yaw * MAX_YAW)
  4333. animWelds.AileronBottomLeft.C0 = ANG(0, 0, bank)
  4334. animWelds.AileronTopLeft.C0 = ANG(0, 0, bank)
  4335. animWelds.AileronBottomRight.C0 = ANG(0, 0, -bank)
  4336. animWelds.AileronTopRight.C0 = ANG(0, 0, -bank)
  4337. animWelds.ElevatorLeft.C0 = ANG(0, 0, pitch)
  4338. animWelds.ElevatorRight.C0 = ANG(0, 0, pitch)
  4339. animWelds.Rudder.C0 = ANG(0, 0, yaw)
  4340. animWelds.Joystick.C0 = ANG(0, RAD(-controlInputs.Y * MAX_JOYSTICK), RAD(-controlInputs.X * MAX_JOYSTICK))
  4341. animWelds.Propeller.C0 = animWelds.Propeller.C0 * ANG(RAD(throttleInput.X * -5000 * dt), 0, 0)
  4342. if (realThrottle < 0.001) then
  4343. realThrottle = 0
  4344. end
  4345. end
  4346.  
  4347. -- Stop the flyer:
  4348. function Flyer:Stop()
  4349. for _,airFoil in pairs(airFoils) do
  4350. airFoil:Stop()
  4351. end
  4352. end
  4353.  
  4354. -- Simulate startup:
  4355. function Flyer:Startup()
  4356. sStartup:Play()
  4357. self.Throttle = 0.5
  4358. end
  4359.  
  4360. -- Simulate shutdown:
  4361. function Flyer:Shutdown()
  4362. sShutdown:Play()
  4363. self.Throttle = 0
  4364. realThrottle = 0
  4365. sIdle:Stop()
  4366. sLowThrottle:Stop()
  4367. sFlying:Stop()
  4368. end
  4369.  
  4370.  
  4371. return Flyer
  4372. end))
  4373. ModuleScript169.Name = "AirFoil"
  4374. ModuleScript169.Parent = ModuleScript168
  4375. table.insert(cors,sandbox(ModuleScript169,function()
  4376. -- Air Foil
  4377. -- Crazyman32
  4378. -- January 18, 2017
  4379.  
  4380. --[[
  4381.  
  4382. References:
  4383. https://www.grc.nasa.gov/www/Wright/airplane/lifteq.html
  4384. https://www.grc.nasa.gov/www/Wright/airplane/drageq.html
  4385. https://www.grc.nasa.gov/www/Wright/airplane/incline.html
  4386.  
  4387.  
  4388. This module handles the aerodynamic physics of a single airfoil by
  4389. constantly calculating the lift and drag forces that act upon the foil.
  4390.  
  4391. Note: This does NOT calculate for gravity. The game engine should invoke gravity itself.
  4392. Note: This assumes a constant air density. Real flight would have dynamic air density based on altitude.
  4393.  
  4394.  
  4395. EXAMPLE USE:
  4396.  
  4397.  
  4398. local AirFoil = require(thisModule)
  4399.  
  4400. local wing = AirFoil.new(part, massOfPlane)
  4401.  
  4402. game:GetService("RunService").Heartbeat:Connect(function()
  4403. wing:Update()
  4404. end)
  4405.  
  4406.  
  4407. Fields:
  4408.  
  4409. airFoil.Part
  4410. airFoil.Area
  4411. airFoil.FrontalArea
  4412. airFoil.VectorForce
  4413. airFoil.DragAtZero
  4414. airFoil.DragEfficiency
  4415. airFoil.MaxForceLift
  4416. airFoil.MaxForceDrag
  4417. airFoil.LiftCoMultiplier
  4418. airFoil.AspectRatio
  4419.  
  4420.  
  4421. Methods:
  4422.  
  4423. airFoil:Update()
  4424. airFoil:Stop()
  4425. airFoil:GetLiftCoefficient(angleOfAttack)
  4426. airFoil:GetDragCoefficient(liftCoefficient)
  4427.  
  4428.  
  4429. NOTE: airFoil:Update() should be called every "Heartbeat" (RunService.Heartbeat)
  4430.  
  4431. --]]
  4432.  
  4433.  
  4434.  
  4435. local AIR_DENSITY = 1.2754
  4436. local PI = math.pi
  4437. local ATAN2 = math.atan2
  4438. local DOT = Vector3.new().Dot
  4439. local MAX = math.max
  4440. local DEG = math.deg
  4441. local RAD = math.rad
  4442. local SIN = math.sin
  4443.  
  4444. local NEAR_ZERO_VECT = Vector3.new(0, 0.001, 0)
  4445.  
  4446.  
  4447. local MAX_FORCE_LIFT = 50000
  4448. local MAX_FORCE_DRAG = 50000
  4449.  
  4450.  
  4451. -- Clamp a Vector3's magnitude if needed: [Only clamps upper limit]
  4452. local function ClampMagnitude(v, mag)
  4453. return (v.Magnitude > mag and (v.Unit * mag) or v)
  4454. end
  4455.  
  4456.  
  4457.  
  4458. local AirFoil = {}
  4459. AirFoil.__index = AirFoil
  4460.  
  4461.  
  4462. -- Construct new airfoil:
  4463. -- part: The foil
  4464. -- airplaneMass: The overall mass of the airplane
  4465. function AirFoil.new(part, airplaneMass, overrideMaxForceLift, overrideMaxForceDrag)
  4466. assert(airplaneMass, "Mass must be set")
  4467.  
  4468. local attachment = Instance.new("Attachment",part)
  4469. local vector_force = Instance.new("VectorForce",part)
  4470. vector_force.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
  4471. vector_force.Attachment0 = attachment
  4472.  
  4473. local airfoil = setmetatable({
  4474. Part = part;
  4475. Area = part.Size.X * part.Size.Z;
  4476. FrontalArea = part.Size.X * part.Size.Y;
  4477.  
  4478. VectorForce = vector_force;
  4479.  
  4480. DragAtZero = 0.1; -- Drag coefficient at zero lift
  4481. DragEfficiency = 0.7;
  4482. MaxForceLift = (overrideMaxForceLift or MAX_FORCE_LIFT) * airplaneMass;
  4483. MaxForceDrag = (overrideMaxForceDrag or MAX_FORCE_DRAG) * airplaneMass;
  4484. LiftCoMultiplier = 0.01;
  4485. AspectRatio = 0;
  4486. }, AirFoil)
  4487. -- Aspect ratio: (Chord^2 / WingArea)
  4488. airfoil.AspectRatio = (part.Size.X * part.Size.X) / airfoil.Area
  4489. return airfoil
  4490. end
  4491.  
  4492.  
  4493. -- Lift Coefficient:
  4494. function AirFoil:GetLiftCoefficient(angleOfAttack)
  4495. -- Somewhat matches a basic lift coefficient graph found online:
  4496. local aoa = DEG(angleOfAttack)
  4497. if (aoa < -5 or aoa > 80) then return 0 end
  4498. local cl = MAX(0, SIN(RAD((aoa + 5) * 4))) * self.LiftCoMultiplier
  4499. return cl
  4500. end
  4501.  
  4502.  
  4503. -- Drag Coefficient:
  4504. function AirFoil:GetDragCoefficient(cl)
  4505.  
  4506. -- DragCoefficient = DragCoefficientAtZeroLift + LiftCoefficient^2 / (Pi * SurfaceAspectRatio * EfficiencyFactor)
  4507.  
  4508. local cd0 = self.DragAtZero
  4509. local e = self.DragEfficiency
  4510. local ar = self.AspectRatio
  4511.  
  4512. return cd0 + (cl * cl) / (PI * ar * e)
  4513.  
  4514. end
  4515.  
  4516.  
  4517. -- Update the air foil (This should ideally be invoked during RunService.Heartbeat)
  4518. -- Heavily commented due to complex nature of operations.
  4519. function AirFoil:Update()
  4520.  
  4521. local part = self.Part
  4522. local v = part.Velocity
  4523. if (v.Magnitude <= 0.0001) then v = NEAR_ZERO_VECT end
  4524.  
  4525. -- Airfoil's velocity relative to its rotation:
  4526. local vLocal = part.CFrame:vectorToObjectSpace(v)
  4527.  
  4528. -- Calculate angle of attack:
  4529. local angleOfAttack = -ATAN2(vLocal.Y, -vLocal.Z)
  4530. --self.AOA = angleOfAttack
  4531.  
  4532. -- Get Lift and Drag Coefficients:
  4533. local lc = self:GetLiftCoefficient(angleOfAttack)
  4534. local dc = self:GetDragCoefficient(lc)
  4535.  
  4536. -- Calculate the part of lift/drag equation that both equations share:
  4537. local common = 0.5 * AIR_DENSITY * DOT(v, v)
  4538.  
  4539. -- Calculate lift and drag force multipliers:
  4540. local lift = common * self.Area * lc * 1.5
  4541. local drag = common * self.FrontalArea * dc * 1.0
  4542.  
  4543. -- Calculate lift and drag:
  4544. local liftForce = part.CFrame.upVector * lift
  4545. local dragForce = -v.Unit * drag
  4546.  
  4547. -- Clamp lift and drag magnitudes:
  4548. liftForce = ClampMagnitude(liftForce, self.MaxForceLift)
  4549. dragForce = ClampMagnitude(dragForce, self.MaxForceDrag)
  4550.  
  4551. -- Apply lift and drag forces to the airfoil:
  4552. local force = (liftForce + dragForce)
  4553. self.VectorForce.Force = self.Part.CFrame:vectorToObjectSpace(force)
  4554. end
  4555.  
  4556.  
  4557. -- Simply sets the VectorForce's force to 0
  4558. function AirFoil:Stop()
  4559. self.VectorForce.Force = Vector3.new()
  4560. end
  4561.  
  4562.  
  4563. return AirFoil
  4564. end))
  4565. ModuleScript170.Name = "Damping"
  4566. ModuleScript170.Parent = ModuleScript168
  4567. table.insert(cors,sandbox(ModuleScript170,function()
  4568. -- Damping
  4569. -- Crazyman32
  4570. -- September 30, 2015
  4571. -- Updated: January 1, 2017
  4572.  
  4573.  
  4574. --[[
  4575.  
  4576. local Damping = require(this)
  4577.  
  4578. local damping = Damping.new()
  4579.  
  4580. damping.P = NUMBER
  4581. damping.D = NUMBER
  4582. damping.Position = Vector3
  4583. damping.Goal = Vector3
  4584.  
  4585. damping:Update() [Returns Vector3 position]
  4586. damping:UpdateAngle() [Returns Vector3 position, but each XYZ value is wrapped properly for pi*2 motion]
  4587.  
  4588.  
  4589.  
  4590. EXAMPLE USE:
  4591.  
  4592. -- Set D and P values:
  4593. damping.P = 5
  4594. damping.D = 0.1
  4595.  
  4596. -- Set starting position:
  4597. damping.Position = part.Position
  4598.  
  4599. while (true) do
  4600.  
  4601. wait()
  4602.  
  4603. -- Update the goal:
  4604. damping.Goal = mouse.Hit.p
  4605.  
  4606. -- Calculate new position:
  4607. local newPosition = damping:Update()
  4608. part.Position = newPosition
  4609.  
  4610. end
  4611.  
  4612.  
  4613.  
  4614. ALGORITHM:
  4615.  
  4616. velocity += P * ( (target - current) + D * -velocity );
  4617. current += velocity * dt;
  4618.  
  4619. Credit: http://www.gamedev.net/topic/561981-smooth-value-damping/
  4620.  
  4621.  
  4622. --]]
  4623.  
  4624.  
  4625. local Damping = {}
  4626. Damping.__index = Damping
  4627.  
  4628. local V3 = Vector3.new
  4629. local PI = math.pi
  4630. local TAU = PI * 2
  4631. local tick = tick
  4632.  
  4633.  
  4634. local function CheckNAN(value, returnIfNan)
  4635. return (value == value and value or returnIfNan)
  4636. end
  4637.  
  4638.  
  4639. local function DeltaAngle(current, target)
  4640. local num = (target - current) % TAU
  4641. if (num > PI) then
  4642. num = (num - TAU)
  4643. end
  4644. return num
  4645. end
  4646.  
  4647.  
  4648. local function DeltaAngleV3(pos1, pos2)
  4649. local x = DeltaAngle(pos1.X, pos2.X)
  4650. local y = DeltaAngle(pos1.Y, pos2.Y)
  4651. local z = DeltaAngle(pos1.Z, pos2.Z)
  4652. return V3(x, y, z)
  4653. end
  4654.  
  4655.  
  4656. function Damping.new()
  4657.  
  4658. local damping = setmetatable({
  4659. P = 5;
  4660. D = 0.1;
  4661. Position = V3();
  4662. Velocity = V3();
  4663. Goal = V3();
  4664. Last = tick();
  4665. }, Damping)
  4666.  
  4667. return damping
  4668.  
  4669. end
  4670.  
  4671.  
  4672. function Damping:CheckNAN()
  4673. self.Velocity = V3(CheckNAN(self.Velocity.X, 0), CheckNAN(self.Velocity.Y, 0), CheckNAN(self.Velocity.Z, 0))
  4674. self.Position = V3(CheckNAN(self.Position.X, self.Goal.X), CheckNAN(self.Position.Y, self.Goal.Y), CheckNAN(self.Position.Z, self.Goal.Z))
  4675. end
  4676.  
  4677.  
  4678. function Damping:Update()
  4679. local t = tick()
  4680. local dt = (t - self.Last)
  4681. self.Last = t
  4682. self.Velocity = (self.Velocity + (self.P * ((self.Goal - self.Position) + (-self.Velocity * self.D))))
  4683. self.Position = (self.Position + (self.Velocity * dt))
  4684. self:CheckNAN()
  4685. return self.Position
  4686. end
  4687.  
  4688.  
  4689. function Damping:UpdateAngle()
  4690. self.Goal = (self.Position + DeltaAngleV3(self.Position, self.Goal))
  4691. return self:Update()
  4692. end
  4693.  
  4694.  
  4695. return Damping
  4696. end))
  4697. Model171.Name = "Parts"
  4698. Model171.Parent = Model1
  4699. Model172.Name = "WingStruts"
  4700. Model172.Parent = Model171
  4701. UnionOperation173.Name = "WingStruts"
  4702. UnionOperation173.Parent = Model172
  4703. UnionOperation173.CFrame = CFrame.new(-69.4999542, 8.48894596, 67.6998291, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4704. UnionOperation173.Orientation = Vector3.new(0, 180, 0)
  4705. UnionOperation173.Position = Vector3.new(-69.4999542, 8.48894596, 67.6998291)
  4706. UnionOperation173.Rotation = Vector3.new(180, 0, 180)
  4707. UnionOperation173.Color = Color3.new(0.486275, 0.360784, 0.27451)
  4708. UnionOperation173.Size = Vector3.new(0.400000304, 5.79999924, 4.24582148)
  4709. UnionOperation173.Anchored = true
  4710. UnionOperation173.BrickColor = BrickColor.new("Brown")
  4711. UnionOperation173.Material = Enum.Material.Wood
  4712. UnionOperation173.brickColor = BrickColor.new("Brown")
  4713. UnionOperation173.UsePartColor = true
  4714. ObjectValue174.Name = "DamageCollider"
  4715. ObjectValue174.Parent = UnionOperation173
  4716. UnionOperation175.Name = "WingStruts"
  4717. UnionOperation175.Parent = Model172
  4718. UnionOperation175.CFrame = CFrame.new(-42.5004807, 8.48895454, 67.6998901, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4719. UnionOperation175.Orientation = Vector3.new(0, 180, 0)
  4720. UnionOperation175.Position = Vector3.new(-42.5004807, 8.48895454, 67.6998901)
  4721. UnionOperation175.Rotation = Vector3.new(180, 0, 180)
  4722. UnionOperation175.Color = Color3.new(0.486275, 0.360784, 0.27451)
  4723. UnionOperation175.Size = Vector3.new(0.400000304, 5.79999924, 4.24582148)
  4724. UnionOperation175.Anchored = true
  4725. UnionOperation175.BrickColor = BrickColor.new("Brown")
  4726. UnionOperation175.Material = Enum.Material.Wood
  4727. UnionOperation175.brickColor = BrickColor.new("Brown")
  4728. UnionOperation175.UsePartColor = true
  4729. ObjectValue176.Name = "DamageCollider"
  4730. ObjectValue176.Parent = UnionOperation175
  4731. Part177.Name = "WingStrut"
  4732. Part177.Parent = Model172
  4733. Part177.CFrame = CFrame.new(-54.1001701, 10.3888988, 68.6998291, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4734. Part177.Orientation = Vector3.new(0, 180, 0)
  4735. Part177.Position = Vector3.new(-54.1001701, 10.3888988, 68.6998291)
  4736. Part177.Rotation = Vector3.new(180, 0, 180)
  4737. Part177.Color = Color3.new(0.486275, 0.360784, 0.27451)
  4738. Part177.Size = Vector3.new(0.200000003, 2, 0.600000024)
  4739. Part177.Anchored = true
  4740. Part177.BottomSurface = Enum.SurfaceType.Smooth
  4741. Part177.BrickColor = BrickColor.new("Brown")
  4742. Part177.Material = Enum.Material.Wood
  4743. Part177.TopSurface = Enum.SurfaceType.Smooth
  4744. Part177.brickColor = BrickColor.new("Brown")
  4745. Part178.Name = "WingStrut"
  4746. Part178.Parent = Model172
  4747. Part178.CFrame = CFrame.new(-57.9000816, 10.3888988, 68.699707, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4748. Part178.Orientation = Vector3.new(0, 180, 0)
  4749. Part178.Position = Vector3.new(-57.9000816, 10.3888988, 68.699707)
  4750. Part178.Rotation = Vector3.new(180, 0, 180)
  4751. Part178.Color = Color3.new(0.486275, 0.360784, 0.27451)
  4752. Part178.Size = Vector3.new(0.200000003, 2, 0.600000024)
  4753. Part178.Anchored = true
  4754. Part178.BottomSurface = Enum.SurfaceType.Smooth
  4755. Part178.BrickColor = BrickColor.new("Brown")
  4756. Part178.Material = Enum.Material.Wood
  4757. Part178.TopSurface = Enum.SurfaceType.Smooth
  4758. Part178.brickColor = BrickColor.new("Brown")
  4759. Model179.Name = "Cockpit"
  4760. Model179.Parent = Model171
  4761. Part180.Name = "CockpitPart"
  4762. Part180.Parent = Model179
  4763. Part180.CFrame = CFrame.new(-54.4998436, 6.88898277, 66.1998901, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4764. Part180.Orientation = Vector3.new(0, 180, 0)
  4765. Part180.Position = Vector3.new(-54.4998436, 6.88898277, 66.1998901)
  4766. Part180.Rotation = Vector3.new(180, 0, 180)
  4767. Part180.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4768. Part180.Size = Vector3.new(1, 1, 2)
  4769. Part180.Anchored = true
  4770. Part180.BottomSurface = Enum.SurfaceType.Smooth
  4771. Part180.BrickColor = BrickColor.new("Grime")
  4772. Part180.CanCollide = false
  4773. Part180.TopSurface = Enum.SurfaceType.Smooth
  4774. Part180.brickColor = BrickColor.new("Grime")
  4775. Part181.Name = "CockpitPart"
  4776. Part181.Parent = Model179
  4777. Part181.CFrame = CFrame.new(-57.5000267, 6.88898754, 66.1999512, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4778. Part181.Orientation = Vector3.new(0, 180, 0)
  4779. Part181.Position = Vector3.new(-57.5000267, 6.88898754, 66.1999512)
  4780. Part181.Rotation = Vector3.new(180, 0, 180)
  4781. Part181.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4782. Part181.Size = Vector3.new(1, 1, 2)
  4783. Part181.Anchored = true
  4784. Part181.BottomSurface = Enum.SurfaceType.Smooth
  4785. Part181.BrickColor = BrickColor.new("Grime")
  4786. Part181.CanCollide = false
  4787. Part181.TopSurface = Enum.SurfaceType.Smooth
  4788. Part181.brickColor = BrickColor.new("Grime")
  4789. Part182.Name = "CockpitPart"
  4790. Part182.Parent = Model179
  4791. Part182.CFrame = CFrame.new(-54.5001183, 7.38896942, 67.6998901, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4792. Part182.Orientation = Vector3.new(0, 180, 0)
  4793. Part182.Position = Vector3.new(-54.5001183, 7.38896942, 67.6998901)
  4794. Part182.Rotation = Vector3.new(180, 0, 180)
  4795. Part182.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4796. Part182.Size = Vector3.new(1, 2, 1)
  4797. Part182.Anchored = true
  4798. Part182.BottomSurface = Enum.SurfaceType.Smooth
  4799. Part182.BrickColor = BrickColor.new("Grime")
  4800. Part182.CanCollide = false
  4801. Part182.TopSurface = Enum.SurfaceType.Smooth
  4802. Part182.brickColor = BrickColor.new("Grime")
  4803. Part183.Name = "CockpitPart"
  4804. Part183.Parent = Model179
  4805. Part183.CFrame = CFrame.new(-57.5001183, 7.38896942, 67.6998291, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4806. Part183.Orientation = Vector3.new(0, 180, 0)
  4807. Part183.Position = Vector3.new(-57.5001183, 7.38896942, 67.6998291)
  4808. Part183.Rotation = Vector3.new(180, 0, 180)
  4809. Part183.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4810. Part183.Size = Vector3.new(1, 2, 1)
  4811. Part183.Anchored = true
  4812. Part183.BottomSurface = Enum.SurfaceType.Smooth
  4813. Part183.BrickColor = BrickColor.new("Grime")
  4814. Part183.CanCollide = false
  4815. Part183.TopSurface = Enum.SurfaceType.Smooth
  4816. Part183.brickColor = BrickColor.new("Grime")
  4817. Part184.Name = "CockpitPart"
  4818. Part184.Parent = Model179
  4819. Part184.CFrame = CFrame.new(-57.5000877, 7.38896847, 64.699707, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4820. Part184.Orientation = Vector3.new(0, 180, 0)
  4821. Part184.Position = Vector3.new(-57.5000877, 7.38896847, 64.699707)
  4822. Part184.Rotation = Vector3.new(180, 0, 180)
  4823. Part184.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4824. Part184.Size = Vector3.new(1, 2, 1)
  4825. Part184.Anchored = true
  4826. Part184.BottomSurface = Enum.SurfaceType.Smooth
  4827. Part184.BrickColor = BrickColor.new("Grime")
  4828. Part184.CanCollide = false
  4829. Part184.TopSurface = Enum.SurfaceType.Smooth
  4830. Part184.brickColor = BrickColor.new("Grime")
  4831. Part185.Name = "CockpitPart"
  4832. Part185.Parent = Model179
  4833. Part185.CFrame = CFrame.new(-56.0000725, 5.88900566, 66.2998047, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4834. Part185.Orientation = Vector3.new(0, 180, 0)
  4835. Part185.Position = Vector3.new(-56.0000725, 5.88900566, 66.2998047)
  4836. Part185.Rotation = Vector3.new(180, 0, 180)
  4837. Part185.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4838. Part185.Size = Vector3.new(4, 1, 8.19999981)
  4839. Part185.Anchored = true
  4840. Part185.BottomSurface = Enum.SurfaceType.Smooth
  4841. Part185.BrickColor = BrickColor.new("Grime")
  4842. Part185.TopSurface = Enum.SurfaceType.Smooth
  4843. Part185.brickColor = BrickColor.new("Grime")
  4844. Part186.Name = "CockpitPart"
  4845. Part186.Parent = Model179
  4846. Part186.CFrame = CFrame.new(-54.5001945, 7.38896847, 64.6998901, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4847. Part186.Orientation = Vector3.new(0, 180, 0)
  4848. Part186.Position = Vector3.new(-54.5001945, 7.38896847, 64.6998901)
  4849. Part186.Rotation = Vector3.new(180, 0, 180)
  4850. Part186.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4851. Part186.Size = Vector3.new(1, 2, 1)
  4852. Part186.Anchored = true
  4853. Part186.BottomSurface = Enum.SurfaceType.Smooth
  4854. Part186.BrickColor = BrickColor.new("Grime")
  4855. Part186.CanCollide = false
  4856. Part186.TopSurface = Enum.SurfaceType.Smooth
  4857. Part186.brickColor = BrickColor.new("Grime")
  4858. Part187.Name = "CockpitPart"
  4859. Part187.Parent = Model179
  4860. Part187.CFrame = CFrame.new(-56.0001335, 7.88896275, 69.2999268, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4861. Part187.Orientation = Vector3.new(0, 180, 0)
  4862. Part187.Position = Vector3.new(-56.0001335, 7.88896275, 69.2999268)
  4863. Part187.Rotation = Vector3.new(180, 0, 180)
  4864. Part187.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4865. Part187.Size = Vector3.new(4, 3, 2.20000005)
  4866. Part187.Anchored = true
  4867. Part187.BottomSurface = Enum.SurfaceType.Smooth
  4868. Part187.BrickColor = BrickColor.new("Grime")
  4869. Part187.TopSurface = Enum.SurfaceType.Smooth
  4870. Part187.brickColor = BrickColor.new("Grime")
  4871. Part188.Name = "CockpitPart"
  4872. Part188.Parent = Model179
  4873. Part188.CFrame = CFrame.new(-56.0001183, 7.88895512, 63.2002563, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4874. Part188.Orientation = Vector3.new(0, 180, 0)
  4875. Part188.Position = Vector3.new(-56.0001183, 7.88895512, 63.2002563)
  4876. Part188.Rotation = Vector3.new(180, 0, 180)
  4877. Part188.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4878. Part188.Size = Vector3.new(4, 3, 2)
  4879. Part188.Anchored = true
  4880. Part188.BottomSurface = Enum.SurfaceType.Smooth
  4881. Part188.BrickColor = BrickColor.new("Grime")
  4882. Part188.CanCollide = false
  4883. Part188.TopSurface = Enum.SurfaceType.Smooth
  4884. Part188.brickColor = BrickColor.new("Grime")
  4885. ObjectValue189.Name = "DamageCollider"
  4886. ObjectValue189.Parent = Part188
  4887. Part190.Name = "SeatBack"
  4888. Part190.Parent = Model179
  4889. Part190.CFrame = CFrame.new(-56.000164, 7.88895512, 64.9998779, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4890. Part190.Orientation = Vector3.new(0, 180, 0)
  4891. Part190.Position = Vector3.new(-56.000164, 7.88895512, 64.9998779)
  4892. Part190.Rotation = Vector3.new(180, 0, 180)
  4893. Part190.Color = Color3.new(0.972549, 0.972549, 0.972549)
  4894. Part190.Size = Vector3.new(2, 3, 0.399999976)
  4895. Part190.Anchored = true
  4896. Part190.BottomSurface = Enum.SurfaceType.Smooth
  4897. Part190.BrickColor = BrickColor.new("Institutional white")
  4898. Part190.CanCollide = false
  4899. Part190.Material = Enum.Material.Fabric
  4900. Part190.TopSurface = Enum.SurfaceType.Smooth
  4901. Part190.brickColor = BrickColor.new("Institutional white")
  4902. Model191.Name = "LandingGear"
  4903. Model191.Parent = Model171
  4904. UnionOperation192.Name = "LandingGear"
  4905. UnionOperation192.Parent = Model191
  4906. UnionOperation192.CFrame = CFrame.new(-55.9999504, 4.16310406, 69.5565796, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4907. UnionOperation192.Orientation = Vector3.new(0, 180, 0)
  4908. UnionOperation192.Position = Vector3.new(-55.9999504, 4.16310406, 69.5565796)
  4909. UnionOperation192.Rotation = Vector3.new(180, 0, 180)
  4910. UnionOperation192.Color = Color3.new(0.486275, 0.360784, 0.27451)
  4911. UnionOperation192.Size = Vector3.new(5, 2.74807787, 1.68660378)
  4912. UnionOperation192.Anchored = true
  4913. UnionOperation192.BrickColor = BrickColor.new("Brown")
  4914. UnionOperation192.Material = Enum.Material.Wood
  4915. UnionOperation192.brickColor = BrickColor.new("Brown")
  4916. UnionOperation192.UsePartColor = true
  4917. Part193.Name = "WheelLeft"
  4918. Part193.Parent = Model191
  4919. Part193.CFrame = CFrame.new(-53.4001884, 2.88909817, 70.3001709, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4920. Part193.Orientation = Vector3.new(0, 180, 0)
  4921. Part193.Position = Vector3.new(-53.4001884, 2.88909817, 70.3001709)
  4922. Part193.Rotation = Vector3.new(180, 0, 180)
  4923. Part193.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  4924. Part193.Size = Vector3.new(0.200000003, 3, 3)
  4925. Part193.Anchored = true
  4926. Part193.BottomSurface = Enum.SurfaceType.Smooth
  4927. Part193.BrickColor = BrickColor.new("Cyan")
  4928. Part193.CustomPhysicalProperties = 7.8499999, 2, 0.25, 2, 1
  4929. Part193.Material = Enum.Material.Metal
  4930. Part193.TopSurface = Enum.SurfaceType.Smooth
  4931. Part193.brickColor = BrickColor.new("Cyan")
  4932. Part193.Shape = Enum.PartType.Cylinder
  4933. HingeConstraint194.Parent = Part193
  4934. HingeConstraint194.Attachment0 = nil
  4935. HingeConstraint194.Attachment1 = nil
  4936. Part195.Name = "WheelRight"
  4937. Part195.Parent = Model191
  4938. Part195.CFrame = CFrame.new(-58.6002159, 2.88910103, 70.3000488, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4939. Part195.Orientation = Vector3.new(0, 180, 0)
  4940. Part195.Position = Vector3.new(-58.6002159, 2.88910103, 70.3000488)
  4941. Part195.Rotation = Vector3.new(180, 0, 180)
  4942. Part195.Color = Color3.new(0.639216, 0.294118, 0.294118)
  4943. Part195.Size = Vector3.new(0.200000003, 3, 3)
  4944. Part195.Anchored = true
  4945. Part195.BottomSurface = Enum.SurfaceType.Smooth
  4946. Part195.BrickColor = BrickColor.new("Dusty Rose")
  4947. Part195.CustomPhysicalProperties = 7.8499999, 2, 0.25, 2, 1
  4948. Part195.Material = Enum.Material.Metal
  4949. Part195.TopSurface = Enum.SurfaceType.Smooth
  4950. Part195.brickColor = BrickColor.new("Dusty Rose")
  4951. Part195.Shape = Enum.PartType.Cylinder
  4952. HingeConstraint196.Parent = Part195
  4953. HingeConstraint196.Attachment0 = nil
  4954. HingeConstraint196.Attachment1 = nil
  4955. Model197.Name = "Tail"
  4956. Model197.Parent = Model171
  4957. Part198.Name = "TailSection"
  4958. Part198.Parent = Model197
  4959. Part198.CFrame = CFrame.new(-56.0000572, 7.38896561, 60.6997681, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4960. Part198.Orientation = Vector3.new(0, 180, 0)
  4961. Part198.Position = Vector3.new(-56.0000572, 7.38896561, 60.6997681)
  4962. Part198.Rotation = Vector3.new(180, 0, 180)
  4963. Part198.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4964. Part198.Size = Vector3.new(3, 3, 3)
  4965. Part198.Anchored = true
  4966. Part198.BottomSurface = Enum.SurfaceType.Smooth
  4967. Part198.BrickColor = BrickColor.new("Grime")
  4968. Part198.TopSurface = Enum.SurfaceType.Smooth
  4969. Part198.brickColor = BrickColor.new("Grime")
  4970. ObjectValue199.Name = "DamageCollider"
  4971. ObjectValue199.Parent = Part198
  4972. Part200.Name = "TailSection"
  4973. Part200.Parent = Model197
  4974. Part200.CFrame = CFrame.new(-56.0000572, 7.38896275, 57.6999512, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4975. Part200.Orientation = Vector3.new(0, 180, 0)
  4976. Part200.Position = Vector3.new(-56.0000572, 7.38896275, 57.6999512)
  4977. Part200.Rotation = Vector3.new(180, 0, 180)
  4978. Part200.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4979. Part200.Size = Vector3.new(2, 2, 3)
  4980. Part200.Anchored = true
  4981. Part200.BottomSurface = Enum.SurfaceType.Smooth
  4982. Part200.BrickColor = BrickColor.new("Grime")
  4983. Part200.TopSurface = Enum.SurfaceType.Smooth
  4984. Part200.brickColor = BrickColor.new("Grime")
  4985. ObjectValue201.Name = "DamageCollider"
  4986. ObjectValue201.Parent = Part200
  4987. Part202.Name = "TailSection"
  4988. Part202.Parent = Model197
  4989. Part202.CFrame = CFrame.new(-56.0000725, 7.38895988, 54.6997681, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  4990. Part202.Orientation = Vector3.new(0, 180, 0)
  4991. Part202.Position = Vector3.new(-56.0000725, 7.38895988, 54.6997681)
  4992. Part202.Rotation = Vector3.new(180, 0, 180)
  4993. Part202.Color = Color3.new(0.498039, 0.556863, 0.392157)
  4994. Part202.Size = Vector3.new(1, 1.39999998, 3)
  4995. Part202.Anchored = true
  4996. Part202.BottomSurface = Enum.SurfaceType.Smooth
  4997. Part202.BrickColor = BrickColor.new("Grime")
  4998. Part202.TopSurface = Enum.SurfaceType.Smooth
  4999. Part202.brickColor = BrickColor.new("Grime")
  5000. ObjectValue203.Name = "DamageCollider"
  5001. ObjectValue203.Parent = Part202
  5002. Part204.Name = "TailSection"
  5003. Part204.Parent = Model197
  5004. Part204.CFrame = CFrame.new(-55.9998741, 7.38894653, 49.699585, -1.00000048, -3.01952296e-10, 3.51518673e-20, 3.01952296e-10, 1, -4.65661287e-10, 3.51518673e-20, 4.65661287e-10, -1)
  5005. Part204.Orientation = Vector3.new(0, 180, 0)
  5006. Part204.Position = Vector3.new(-55.9998741, 7.38894653, 49.699585)
  5007. Part204.Rotation = Vector3.new(180, 0, 180)
  5008. Part204.Color = Color3.new(0.498039, 0.556863, 0.392157)
  5009. Part204.Size = Vector3.new(0.400000006, 1, 7)
  5010. Part204.Anchored = true
  5011. Part204.BottomSurface = Enum.SurfaceType.Smooth
  5012. Part204.BrickColor = BrickColor.new("Grime")
  5013. Part204.TopSurface = Enum.SurfaceType.Smooth
  5014. Part204.brickColor = BrickColor.new("Grime")
  5015. ObjectValue205.Name = "DamageCollider"
  5016. ObjectValue205.Parent = Part204
  5017. Part206.Name = "RegenButton"
  5018. Part206.Parent = Model0
  5019. Part206.CFrame = CFrame.new(-28.58358, 0.587299347, 50.3664551, -0.000334412878, -0.0429414362, 0.999077916, 0.0156064332, 0.998955727, 0.0429414026, -0.999878168, 0.0156063959, 0.000336099416)
  5020. Part206.Orientation = Vector3.new(-2.46000004, 89.9800034, 0.899999976)
  5021. Part206.Position = Vector3.new(-28.58358, 0.587299347, 50.3664551)
  5022. Part206.Rotation = Vector3.new(-89.5500031, 87.5400009, 90.4499969)
  5023. Part206.Color = Color3.new(0.627451, 0.372549, 0.207843)
  5024. Part206.Size = Vector3.new(3, 1, 3)
  5025. Part206.Anchored = true
  5026. Part206.BottomSurface = Enum.SurfaceType.Smooth
  5027. Part206.BrickColor = BrickColor.new("Dark orange")
  5028. Part206.CanCollide = false
  5029. Part206.Material = Enum.Material.Wood
  5030. Part206.TopSurface = Enum.SurfaceType.Smooth
  5031. Part206.brickColor = BrickColor.new("Dark orange")
  5032. SurfaceGui207.Parent = Part206
  5033. SurfaceGui207.Face = Enum.NormalId.Top
  5034. SurfaceGui207.CanvasSize = Vector2.new(400, 400)
  5035. TextLabel208.Name = "Label"
  5036. TextLabel208.Parent = SurfaceGui207
  5037. TextLabel208.Size = UDim2.new(1, 0, 1, 0)
  5038. TextLabel208.BackgroundColor = BrickColor.new("Institutional white")
  5039. TextLabel208.BackgroundColor3 = Color3.new(1, 1, 1)
  5040. TextLabel208.BackgroundTransparency = 1
  5041. TextLabel208.Font = Enum.Font.SourceSans
  5042. TextLabel208.FontSize = Enum.FontSize.Size96
  5043. TextLabel208.Text = "Touch to Spawn Plane"
  5044. TextLabel208.TextColor = BrickColor.new("Institutional white")
  5045. TextLabel208.TextColor3 = Color3.new(1, 1, 1)
  5046. TextLabel208.TextSize = 96
  5047. TextLabel208.TextWrap = true
  5048. TextLabel208.TextWrapped = true
  5049. Script209.Name = "Regeneration"
  5050. Script209.Parent = Model0
  5051. table.insert(cors,sandbox(Script209,function()
  5052. -- Regeneration
  5053. -- Crazyman32
  5054. -- January 19, 2017
  5055.  
  5056. --[[
  5057.  
  5058. This script allows the plane to be regenerated cleanly. The idea of
  5059. vehicle regeneration (or "regen" for short) goes back to old ROBLOX
  5060. vehicles (from 2007/2008). With those old systems, the word
  5061. "regeneration" was more appropriate, since there would only be one
  5062. vehicle per system, so regenerating the vehicle was literally the
  5063. process of getting rid of the old one (if it was still there) and
  5064. putting a new one in its place.
  5065.  
  5066. Nowadays, "regen" systems are more-so just vehicle spawn points. For
  5067. the sake of old consistency, I like to keep the name "Regeneration."
  5068.  
  5069.  
  5070.  
  5071. Logic of the regeneration system:
  5072.  
  5073. 1. Player touches the button.
  5074. If the system is active, STOP. Else, go to step 2.
  5075.  
  5076. 2. Set the regen system as "active."
  5077.  
  5078. 3. Remove idle planes within the regeneration radius.
  5079.  
  5080. 4. Check if the regeneration radius is clear.
  5081. If the system is clear, go to step 5. Else, STOP.
  5082.  
  5083. 5. Regenerate plane (i.e. create a new copy of the plane and spawn it).
  5084.  
  5085. 6. Wait a few seconds (cooldown) so that players cannot spam regen button.
  5086.  
  5087. 7. Set the regen system as "not active."
  5088.  
  5089. --]]
  5090.  
  5091.  
  5092.  
  5093. -- If another plane in the system is within this radius of the respawn
  5094. -- area, then the system will deny a regeneration request:
  5095. local REGEN_RADIUS = 30
  5096.  
  5097. -- If a plane is idle for this many seconds, then the plane will be
  5098. -- destroyed. A plane is considered idle when a player exits the
  5099. -- pilot seat:
  5100. local MAX_IDLE_BEFORE_CLEANUP = 30
  5101.  
  5102. -- Seconds to wait after a regen before another regen is allowed:
  5103. local COOLDOWN = 5
  5104.  
  5105. -- The name of the plane within the plane system:
  5106. local PLANE_NAME = "Plane"
  5107.  
  5108.  
  5109.  
  5110.  
  5111. local regenBtn = script.Parent:FindFirstChild("RegenButton")
  5112. local regenLbl = (regenBtn and regenBtn:FindFirstChild("SurfaceGui") and regenBtn.SurfaceGui:FindFirstChild("Label"))
  5113.  
  5114. local plane = script.Parent[PLANE_NAME]
  5115. if (regenBtn) then
  5116. plane = plane:Clone()
  5117. end
  5118.  
  5119. local regenPos = plane:WaitForChild("Functional"):WaitForChild("PilotSeat").Position
  5120.  
  5121. -- Button debounce:
  5122. local active = false
  5123.  
  5124.  
  5125. function Track(p)
  5126.  
  5127. -- Inform welder script that it can go ahead and weld the plane:
  5128. p:WaitForChild("ReadyToWeld").Value = true
  5129.  
  5130. local seat = p:WaitForChild("Functional"):WaitForChild("PilotSeat")
  5131. local idleTag = -1
  5132.  
  5133. -- Mark plane as idle and destroy the plane if it is idle too long:
  5134. local function Idle()
  5135. local tag = tick()
  5136. idleTag = tag
  5137. while (tag == idleTag) do
  5138. local dur = (tick() - tag)
  5139. if (dur > MAX_IDLE_BEFORE_CLEANUP) then
  5140. p:Destroy()
  5141. break
  5142. end
  5143. wait(1)
  5144. end
  5145. end
  5146.  
  5147. -- Listen for players to sit or get out of the pilot seat:
  5148. seat.Changed:Connect(function(prop)
  5149. if (prop == "Occupant") then
  5150. if (seat.Occupant) then
  5151. -- New occupant; the plane is no longer idle:
  5152. idleTag = -1
  5153. else
  5154. -- No occupant; mark the plane as idle:
  5155. spawn(Idle)
  5156. end
  5157. end
  5158. end)
  5159.  
  5160. end
  5161.  
  5162.  
  5163. -- Regenerate (i.e. "respawn") the plane:
  5164. function Regen()
  5165. local p = plane:Clone()
  5166. p.Parent = script.Parent
  5167. p:MakeJoints()
  5168. wait(0.5)
  5169. Track(p)
  5170. end
  5171.  
  5172.  
  5173. -- Set the transparency of the regen button and it's text label:
  5174. function SetTransparency(t)
  5175. if (regenBtn) then
  5176. regenBtn.Transparency = t
  5177. if (regenLbl) then
  5178. regenLbl.TextTransparency = t
  5179. end
  5180. end
  5181. end
  5182.  
  5183.  
  5184. -- Check if the spawn location is clear (also removes idle planes within spawn radius):
  5185. function IsSpawnClear()
  5186. local isClear = true
  5187. local clearedPlane = false
  5188. for _,v in pairs(script.Parent:GetChildren()) do
  5189. if (v.Name == plane.Name and v:FindFirstChild("Functional") and v.Functional:FindFirstChild("PilotSeat")) then
  5190. local seat = v.Functional.PilotSeat
  5191. local dist = (seat.Position - regenPos).Magnitude
  5192. if (dist < REGEN_RADIUS) then
  5193. if (seat.Occupant) then
  5194. isClear = false
  5195. else
  5196. v:Destroy()
  5197. clearedPlane = true
  5198. end
  5199. end
  5200. end
  5201. end
  5202. if (clearedPlane and isClear) then
  5203. wait(1)
  5204. end
  5205. return isClear
  5206. end
  5207.  
  5208.  
  5209. -- Regen button is touched:
  5210. function RegenTouched(object)
  5211.  
  5212. -- Debounce:
  5213. if (active) then return end
  5214.  
  5215. active = true
  5216. local player = game.Players:GetPlayerFromCharacter(object.Parent)
  5217.  
  5218. -- If we've confirmed it was a player that touched the regen button:
  5219. if (player) then
  5220. SetTransparency(0.5)
  5221. -- If the spawn isn't clear, don't regenerate a plane:
  5222. if (not IsSpawnClear()) then
  5223. SetTransparency(0)
  5224. active = false
  5225. return
  5226. end
  5227. SetTransparency(1)
  5228. -- Regenerate a plane:
  5229. Regen()
  5230. wait(COOLDOWN)
  5231. SetTransparency(0)
  5232. end
  5233.  
  5234. active = false
  5235.  
  5236. end
  5237.  
  5238.  
  5239. -- Track button touches:
  5240. if (regenBtn) then
  5241. regenBtn.Touched:Connect(RegenTouched)
  5242. end
  5243.  
  5244. -- Set up the initial aircraft in the system:
  5245. Track(script.Parent[PLANE_NAME])
  5246. end))
  5247. Script210.Name = "README"
  5248. Script210.Parent = Model0
  5249. table.insert(cors,sandbox(Script210,function()
  5250. --[[
  5251.  
  5252. Creator: Crazyman32 https://www.roblox.com/users/308165/profile
  5253.  
  5254. The purpose of creating this plane was to attempt to simulate real
  5255. aerophysics of an aircraft. It is not perfect! Feel free to edit
  5256. things as you wish.
  5257.  
  5258. I have tried to write these scripts in a manner that would be
  5259. readable, and have included many comments throughout every single
  5260. script.
  5261.  
  5262.  
  5263.  
  5264. -----------------------------------------------------------------------------------------
  5265.  
  5266. The section below goes into high-level detail of each script
  5267. in the plane. If you're wondering what one of the scripts does,
  5268. then this is the place for you!
  5269.  
  5270. Script outline:
  5271.  
  5272. system > Regeneration
  5273. Regeneration script. Handles respawning the aircraft.
  5274.  
  5275. system > Plane > Welder
  5276. Welds the plane together. The Regeneration script needs to inform
  5277. this script to start. Yields until that occurs.
  5278.  
  5279. system > Plane > Damage
  5280. Handles plane damage and removal after death.
  5281.  
  5282. system > Plane > Flyer
  5283. The heart of the aircraft. This module is responsible for properly
  5284. setting up and simulating the aircraft as a whole. This module is
  5285. used both server-side and client-side.
  5286.  
  5287. system > Plane > Flyer > AirFoil
  5288. This is the phsyics simulator per air foil. A "foil" is simply
  5289. some sort of surface that is simulated through some sort of
  5290. fluid; in this case, air. An example of an air foil is a wing.
  5291. To put it simply, the AirFoil module calculates lift and drag
  5292. forces on a part based on the parts orientation and velocity.
  5293.  
  5294. system > Plane > Flyer > Damping
  5295. This is a module used by the flyer and also the CamLock module. It
  5296. is used to damp various controls and inputs, which makes things
  5297. appear much smoother. NOTE that "Damping" is not the same as "Dampening."
  5298. According to dictionary.com, the word Damping can mean "a reduction
  5299. in the amplitude of an oscillation or vibration as a result of energy
  5300. being dissipated as heat." For example, think of the smooth movements
  5301. of a hydraulic system. Such a system can somewhat be immitated through
  5302. using this module.
  5303.  
  5304. system > Plane > Controller
  5305. This is the server-side controller for the aircraft. It has a
  5306. couple of functions. Firstly, it simulates the plane's physics
  5307. when no player is in the plane. Secondly, it handles when a
  5308. player enters or exits the Pilot Seat. When a player enters
  5309. the seat, this script gives over the controls to the player by
  5310. cloning the LocalController script into the player's Backpack.
  5311. When the player leaves the aircraft, this script removes the
  5312. LocalController from the player and takes over physics simulation
  5313. again.
  5314.  
  5315. system > Plane > Controller > LocalController
  5316. This is the client-side controller for the plane. This script
  5317. allows the player to actually control the aircraft.
  5318.  
  5319. system > Plane > Controller > LocalController > CamLock
  5320. Handles the player's camera while in the plane. This uses complex
  5321. operations to maintain fluid camera movements and interpolations
  5322. between views, as well as simulate a feeling of "movement" in the
  5323. plane by rotating and shaking the camera based on plane movement.
  5324.  
  5325. system > Plane > Controller > LocalController > Controls
  5326. This module holds other control modules that simplify user input.
  5327. The LocalController uses these modules to read user input in order
  5328. to maneuver the aircraft.
  5329.  
  5330. system > Plane > Controller > LocalController > (GUI) > GuiController
  5331. For each ScreenGui, there is a a GuiController module. This module
  5332. is what keeps the the UI updated and also sends UI information
  5333. back to the LocalController. Each GuiController is unique in its
  5334. operations and is chosen based on which platform the user is using.
  5335.  
  5336.  
  5337.  
  5338. -----------------------------------------------------------------------------------------
  5339.  
  5340.  
  5341.  
  5342. Order of script operations:
  5343.  
  5344. 1. Regeneration script respawns a new plane
  5345.  
  5346. 2. Regeneration script informs the plane's Welder script to weld
  5347. the plane
  5348.  
  5349. 3. Welder script welds the plane, and creates an object to denote
  5350. the plane is welded
  5351.  
  5352. 4. Damage script starts working by watching parts for high-velocity
  5353. touches
  5354.  
  5355. 5. Controller script sees that the plane is welded, and starts its
  5356. operations
  5357.  
  5358. 5.1. Controller script sees a player enter the PilotSeat, and gives
  5359. the player the LocalController script
  5360.  
  5361. 5.2. LocalController script operates and allows the player to fly the
  5362. plane
  5363.  
  5364. 5.3. Controller script sees the player leave th PilotSeat, and removes
  5365. the LocalController script from the player
  5366.  
  5367.  
  5368. -----------------------------------------------------------------------------------------
  5369.  
  5370.  
  5371. Build notes:
  5372.  
  5373. - All parts that scripts interact with are located in the plane's
  5374. "Functional" model
  5375.  
  5376. - All parts in the "Parts" model are simply for looks (however, some may
  5377. also be used to listen for touches in the Damage script)
  5378.  
  5379. - Any part that contains a "DamageCollider" object will be used by the
  5380. Damage script to listen for high-velocity touches/impacts
  5381.  
  5382. - The design is supposed to look simple/blocky, since the goal was a
  5383. realistic-flying plane, not a realistic-looking plane
  5384.  
  5385.  
  5386. --]]
  5387. end))
  5388. Script210.Disabled = true
  5389. for i,v in pairs(mas:GetChildren()) do
  5390. v.Parent = workspace
  5391. pcall(function() v:MakeJoints() end)
  5392. end
  5393. mas:Destroy()
  5394. for i,v in pairs(cors) do
  5395. spawn(function()
  5396. pcall(v)
  5397. end)
  5398. end
  5399.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement