Advertisement
ttyyuu12345

basic plane

Sep 30th, 2016
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.78 KB | None | 0 0
  1. --Created with ttyyuu12345's compiler
  2. --ttyyuu12345 is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --ttyyuu12345 cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors:
  11. local Create = function(itemClass,tabl)
  12. local item = Instance.new(itemClass)
  13. for i,v in pairs(tabl) do
  14. local a,b = ypcall(function() return item[i] end)
  15. if a then
  16. item[i] = tabl[i]
  17. end
  18. end
  19. return item
  20. end
  21.  
  22. local runDummyScript = function(f,scri)
  23. local oldenv = getfenv(f)
  24. local newenv = setmetatable({}, {
  25. __index = function(_, k)
  26. if k:lower() == 'script' then
  27. return scri
  28. else
  29. return oldenv[k]
  30. end
  31. end
  32. })
  33. setfenv(f, newenv)
  34. ypcall(function() f() end)
  35. end
  36. cors = {}
  37. mas = Instance.new("Model",game:GetService("Lighting"))
  38. mas.Name = "CompiledModel"
  39. o1 = Create("Model",{
  40. ["Name"] = "Set",
  41. ["Parent"] = mas,
  42. })
  43. o2 = Create("Part",{
  44. ["Name"] = "Regen",
  45. ["Parent"] = o1,
  46. ["Position"] = Vector3.new(-25, 0.200014994, 22),
  47. ["Rotation"] = Vector3.new(-0, 90, 0),
  48. ["Anchored"] = true,
  49. ["CFrame"] = CFrame.new(-25, 0.200014994, 22, -0, 0, 1, -0, 1, 0, -1, 0, 0),
  50. ["FormFactor"] = Enum.FormFactor.Plate,
  51. ["Size"] = Vector3.new(10, 0.400000006, 14),
  52. })
  53. o3 = Create("Script",{
  54. ["Parent"] = o2,
  55. })
  56. table.insert(cors,coroutine.create(function()
  57. wait()
  58. runDummyScript(function()
  59. local current = script.Parent.Parent:FindFirstChild("Plane")
  60. local copy = current:Clone()
  61.  
  62. function add()
  63. if current.Parent then
  64. current.Parent = game.Workspace
  65. end
  66. local c = copy:Clone()
  67. c.Parent = script.Parent.Parent
  68. c:makeJoints()
  69. current = c
  70. end
  71.  
  72. while true do
  73. wait(5)
  74. if script.Parent.Parent:FindFirstChild(current.Name) == nil
  75. or (current:FindFirstChild("VehicleSeat")
  76. and (script.Parent.Position - current.VehicleSeat.Position).magnitude > 20) then
  77. add()
  78. end
  79. end
  80.  
  81. end,o3)
  82. end))
  83. o4 = Create("Model",{
  84. ["Name"] = "Plane",
  85. ["Parent"] = o1,
  86. })
  87. o5 = Create("Part",{
  88. ["Name"] = "Front",
  89. ["Parent"] = o4,
  90. ["BrickColor"] = BrickColor.new("Dark orange"),
  91. ["Position"] = Vector3.new(-25, 2.10001707, 18.5),
  92. ["Rotation"] = Vector3.new(0, 90, 0),
  93. ["CFrame"] = CFrame.new(-25, 2.10001707, 18.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  94. ["FormFactor"] = Enum.FormFactor.Symmetric,
  95. ["Size"] = Vector3.new(1, 2, 4),
  96. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  97. })
  98. o6 = Create("Part",{
  99. ["Name"] = "Lever",
  100. ["Parent"] = o4,
  101. ["BrickColor"] = BrickColor.new("Really red"),
  102. ["Position"] = Vector3.new(-25, 3.30001402, 18.5),
  103. ["Rotation"] = Vector3.new(0, 90, 0),
  104. ["CFrame"] = CFrame.new(-25, 3.30001402, 18.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  105. ["FormFactor"] = Enum.FormFactor.Plate,
  106. ["Size"] = Vector3.new(1, 0.400000006, 4),
  107. ["BackSurface"] = Enum.SurfaceType.Weld,
  108. ["Color"] = Color3.new(1, 0, 0),
  109. })
  110. o7 = Create("VehicleSeat",{
  111. ["Parent"] = o4,
  112. ["BrickColor"] = BrickColor.new("Navy blue"),
  113. ["Position"] = Vector3.new(-25, 1.60001695, 22),
  114. ["CFrame"] = CFrame.new(-25, 1.60001695, 22, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  115. ["Size"] = Vector3.new(2, 1, 2),
  116. ["MaxSpeed"] = 0,
  117. ["Torque"] = 0,
  118. ["TurnSpeed"] = 0,
  119. ["Color"] = Color3.new(0, 0.12549, 0.376471),
  120. })
  121. o8 = Create("Script",{
  122. ["Name"] = "Main",
  123. ["Parent"] = o7,
  124. })
  125. table.insert(cors,coroutine.create(function()
  126. wait()
  127. runDummyScript(function()
  128. -- Anaminus
  129.  
  130. --[[Manual:
  131.  
  132. Controls:
  133. Hop in and click anywhere on the plane to start.
  134. Click on the plane again to stop.
  135. Use WASD or arrow keys to pitch and roll.
  136. W (Up) -> Pitch Down
  137. S (Down) -> Pitch Up
  138. A (Left) -> Roll Left
  139. D (Right) -> Roll Right
  140.  
  141. Tip: Roll to the direction you want to go,
  142. then pitch up to turn in that direction
  143.  
  144. Speeds:
  145. Speed -> How fast the plane will fly
  146. Pitch -> How fast the plane will move up/down
  147. Roll -> How fast the plane will move left/right
  148.  
  149. No tools required to operate!
  150. ]]
  151.  
  152. wait()
  153.  
  154. local engine = script.Parent
  155. local plane = engine.Parent
  156. local bottom = plane.Bottom
  157. local workspace = workspace
  158. local bg = Instance.new("BodyGyro")
  159. local bv = Instance.new("BodyVelocity")
  160. local click = Instance.new("ClickDetector")
  161.  
  162. local running = false
  163. local dead = false
  164. local vaccant = true
  165.  
  166. click_con = nil
  167. bottom_con = nil
  168. engine_con = nil
  169. seat_con = nil
  170.  
  171. local addon = Instance.new("ObjectValue")
  172. addon.Name = "Plane"
  173. addon.Value = plane
  174.  
  175. bg.Parent = engine
  176. bv.Parent = engine
  177. bv.maxForce = Vector3.new(0,0,0)
  178. bg.maxTorque = Vector3.new(0,0,0)
  179. bg.cframe = engine.CFrame
  180.  
  181. click.Parent = plane
  182.  
  183. local weld
  184. if bottom:FindFirstChild("Weld") then
  185. weld = bottom.Weld
  186. else
  187. weld = Instance.new("Weld")
  188. end
  189. weld.Part0 = bottom
  190. weld.Part1 = engine
  191. weld.C0 = bottom.CFrame:inverse() * CFrame.new(bottom.Position)
  192. weld.C1 = engine.CFrame:inverse() * CFrame.new(bottom.Position)
  193. weld.Parent = bottom
  194.  
  195. click_con = click.MouseClick:connect(function()
  196. if vaccant then return end
  197. running = not running
  198. if running then
  199. bv.maxForce = Vector3.new(9e+004, 9e+004, 9e+004)
  200. bg.maxTorque = Vector3.new(9e+004, 9e+004, 9e+004)
  201. bg.cframe = engine.CFrame
  202. if plane:FindFirstChild("Lever") then
  203. plane.Lever.BrickColor = BrickColor.new("Lime green")
  204. end
  205. else
  206. bv.maxForce = Vector3.new(0,0,0)
  207. bg.maxTorque = Vector3.new(0,0,0)
  208. if plane:FindFirstChild("Lever") then
  209. plane.Lever.BrickColor = BrickColor.new("Really red")
  210. end
  211. end
  212. end)
  213.  
  214. engine_con = engine.ChildAdded:connect(function(child)
  215. if child.Name == "SeatWeld" then
  216. vaccant = false
  217. child.C0 = CFrame.new(0,(engine.Size.y/2 + 1.5),0)
  218. child.C1 = CFrame.new(0,0,0)
  219. local character = child.Part1.Parent
  220. addon.Parent = character
  221. end
  222.  
  223. end)
  224.  
  225. seat_con = engine.ChildRemoved:connect(function(child)
  226. if child.Name == "SeatWeld" then
  227. local character = child.Part1.Parent
  228. addon.Parent = nil
  229. vaccant = true
  230. end
  231. end)
  232.  
  233. bottom_con = bottom.ChildRemoved:connect(function(child)
  234. if child == weld then
  235. click_con:disconnect()
  236. engine_con:disconnect()
  237. seat_con:disconnect()
  238. bottom_con:disconnect()
  239. plane:BreakJoints()
  240. running = false
  241. dead = true
  242. bg:Remove()
  243. bv:Remove()
  244. wait(2)
  245. plane:Remove()
  246. end
  247. end)
  248.  
  249. while not dead do
  250. bv.velocity = engine.CFrame.lookVector * script.Speed.Value
  251. bg.cframe = engine.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(
  252. math.rad(script.Pitch.Value * -engine.Throttle),
  253. 0,
  254. math.rad(script.Roll.Value * -engine.Steer))
  255. wait()
  256. end
  257.  
  258. end,o8)
  259. end))
  260. o9 = Create("NumberValue",{
  261. ["Name"] = "Speed",
  262. ["Parent"] = o8,
  263. ["Value"] = 50,
  264. })
  265. o10 = Create("NumberValue",{
  266. ["Name"] = "Roll",
  267. ["Parent"] = o8,
  268. ["Value"] = 5,
  269. })
  270. o11 = Create("NumberValue",{
  271. ["Name"] = "Pitch",
  272. ["Parent"] = o8,
  273. ["Value"] = 3.5,
  274. })
  275. o12 = Create("Part",{
  276. ["Name"] = "Cardboard",
  277. ["Parent"] = o4,
  278. ["BrickColor"] = BrickColor.new("Dark orange"),
  279. ["Position"] = Vector3.new(-23.5, 2.10001707, 22),
  280. ["Rotation"] = Vector3.new(0, 90, 0),
  281. ["CFrame"] = CFrame.new(-23.5, 2.10001707, 22, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  282. ["FormFactor"] = Enum.FormFactor.Symmetric,
  283. ["Size"] = Vector3.new(6, 2, 1),
  284. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  285. })
  286. o13 = Create("Part",{
  287. ["Name"] = "Bottom",
  288. ["Parent"] = o4,
  289. ["BrickColor"] = BrickColor.new("Dark orange"),
  290. ["Position"] = Vector3.new(-25, 0.900020003, 22),
  291. ["Rotation"] = Vector3.new(0, 90, 0),
  292. ["CFrame"] = CFrame.new(-25, 0.900020003, 22, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  293. ["FormFactor"] = Enum.FormFactor.Plate,
  294. ["Size"] = Vector3.new(8, 0.400000006, 4),
  295. ["BottomSurface"] = Enum.SurfaceType.Smooth,
  296. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  297. })
  298. o14 = Create("Part",{
  299. ["Name"] = "Cardboard",
  300. ["Parent"] = o4,
  301. ["BrickColor"] = BrickColor.new("Dark orange"),
  302. ["Position"] = Vector3.new(-26.5, 2.10001612, 22),
  303. ["Rotation"] = Vector3.new(0, 90, 0),
  304. ["CFrame"] = CFrame.new(-26.5, 2.10001612, 22, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  305. ["FormFactor"] = Enum.FormFactor.Symmetric,
  306. ["Size"] = Vector3.new(6, 2, 1),
  307. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  308. })
  309. o15 = Create("Part",{
  310. ["Name"] = "RWing",
  311. ["Parent"] = o4,
  312. ["BrickColor"] = BrickColor.new("Dark orange"),
  313. ["Position"] = Vector3.new(-21, 2.30001402, 22),
  314. ["Rotation"] = Vector3.new(0, 90, 0),
  315. ["CFrame"] = CFrame.new(-21, 2.30001402, 22, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  316. ["FormFactor"] = Enum.FormFactor.Plate,
  317. ["Size"] = Vector3.new(2, 0.400000006, 4),
  318. ["FrontSurface"] = Enum.SurfaceType.Weld,
  319. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  320. })
  321. o16 = Create("Part",{
  322. ["Name"] = "Cardboard",
  323. ["Parent"] = o4,
  324. ["BrickColor"] = BrickColor.new("Dark orange"),
  325. ["Position"] = Vector3.new(-25, 2.10001612, 25.5),
  326. ["Rotation"] = Vector3.new(0, 90, 0),
  327. ["CFrame"] = CFrame.new(-25, 2.10001612, 25.5, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  328. ["FormFactor"] = Enum.FormFactor.Symmetric,
  329. ["Size"] = Vector3.new(1, 2, 4),
  330. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  331. })
  332. o17 = Create("Part",{
  333. ["Name"] = "LWing",
  334. ["Parent"] = o4,
  335. ["BrickColor"] = BrickColor.new("Dark orange"),
  336. ["Position"] = Vector3.new(-29, 2.30001307, 22),
  337. ["Rotation"] = Vector3.new(0, 90, 0),
  338. ["CFrame"] = CFrame.new(-29, 2.30001307, 22, 0, 0, 1, 0, 1, 0, -1, 0, 0),
  339. ["FormFactor"] = Enum.FormFactor.Plate,
  340. ["Size"] = Vector3.new(2, 0.400000006, 4),
  341. ["BackSurface"] = Enum.SurfaceType.Weld,
  342. ["Color"] = Color3.new(0.627451, 0.372549, 0.207843),
  343. })
  344. mas.Parent = workspace
  345. mas:MakeJoints()
  346. local mas1 = mas:GetChildren()
  347. for i=1,#mas1 do
  348. mas1[i].Parent = workspace
  349. ypcall(function() mas1[i]:MakeJoints() end)
  350. end
  351. mas:Destroy()
  352. for i=1,#cors do
  353. coroutine.resume(cors[i])
  354. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement