Advertisement
anphu04

plane crash main script

Sep 6th, 2017
3,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.21 KB | None | 0 0
  1. function waitForChild(parent, name)
  2. while parent:FindFirstChild(name) == nil do -- if the object can't be found inside the parent, the script will wait for it (this is unstable because it might freeze the script while waiting)
  3. wait()
  4. end
  5. return parent:FindFirstChild(name) -- this will return the OBJECT that the script found, it means that you can either clone or delete it
  6. end
  7.  
  8. local planemodel = waitForChild(game.Workspace, "Plane"):Clone()
  9. wait(5)
  10. local wii = game.Workspace.Wii
  11. local boss = game.Workspace.BossMusic
  12. local isis = game.Workspace.ISIS
  13. local isisexplosion = game.Workspace.ISISExplosion
  14. local firenoise = game.Workspace.FireNoise
  15. local trump = game.Workspace.WeAreNumberTrump
  16. local heavywind = game.Workspace.HeavyWind
  17. local tornadowind = game.Workspace.TornadoWind
  18. local rain = game.Workspace.Rain
  19. local thunder = game.Workspace.Thunder
  20. local running90s = game.Workspace:FindFirstChild("90s")
  21. local sonic = game.Workspace.SuperSonic
  22. local dubstep = game.Workspace.LazorDubstep
  23. local lazor = game.Workspace.FiringLazor
  24. local tooslow = game.Workspace.TooSlow
  25. local sanics = game.Workspace.SanicSong
  26. local nyans = game.Workspace.NyanCatSong
  27. local rainingmen = game.Workspace.RainingMen
  28. local fidgets = game.Workspace.FidgetSpinnerSong
  29. local normalexplosion = game.Workspace.NormalExplosion
  30.  
  31. local launch = game.Workspace.Launch
  32. local explosionv = game.Workspace.explosion
  33. local hasglitched = game.Workspace.PlaneHasGlitched
  34. local glitchdetector = game.Workspace.BrickToSeeIfPlaneHasGlitch.Check
  35. local dooropen = game.Workspace.DoorOpened
  36. local conveyor = game.Workspace.ConveyorOn
  37.  
  38. local triggers = game.Workspace.EVENT_TRIGGERS
  39. local timesup = false
  40.  
  41.  
  42. local events = {
  43. "Normal",
  44. "Terrorist",
  45. "Fire",
  46. "Trump",
  47. "Tornado",
  48. "Lightning",
  49. "Nuke",
  50. "90s",
  51. "Shoop Da Woop",
  52. "Sanic",
  53. "Nyan Cat",
  54. "Raining Bomb",
  55. "Fidget Spinner"
  56. }
  57.  
  58.  
  59. function countdown()
  60. wii:Play()
  61. local h = Instance.new("Hint", game.Workspace)
  62. h.Text = "The next flight will arrive shortly, please wait..."
  63. wait(3)
  64. glitchdetector.Disabled = false -- when the plane respawn, it gets very glitchy even though later it's fine, so we will wait before actually checking is it glitched or not
  65. h.Text = "The plane has arrived!"
  66. launch.Value = false
  67. dooropen.Value = true
  68. wait(5)
  69.  
  70. local seconds = 20
  71. for i = 1, 20 do
  72. h.Text = "The current plane will leave in " ..seconds.. " seconds."
  73. seconds = seconds - 1
  74. wait(1)
  75. end
  76.  
  77. h.Text = "The current plane is about to leave. Have a nice trip!"
  78. wait(5)
  79. h:remove()
  80. dooropen.Value = false
  81. wii:Stop()
  82. end
  83.  
  84.  
  85. function setEventTime(Time)
  86. for i = Time, 0, -1 do -- the second value is 0 because you want the timer to countdown all the way to 0
  87. local eventtime = game.Workspace:FindFirstChild("EventTime")
  88. if eventtime ~= nil then
  89. eventtime.Value = i
  90. end
  91. wait(1)
  92. end
  93. timesup = true
  94. end
  95.  
  96.  
  97. while true do
  98. countdown()
  99. local chosenevent = events[math.random(1, #events)]
  100. print("Now playing: " ..chosenevent.. " event")
  101. timesup = false -- reset the time for another event to occur
  102.  
  103. if chosenevent == "Normal" then
  104. if hasglitched.Value == false then
  105. glitchdetector.Disabled = true
  106.  
  107. local routine = coroutine.create(setEventTime)
  108. coroutine.resume(routine, 120)
  109.  
  110. local plane = game.Workspace:FindFirstChild("Plane")
  111. boss:Play()
  112. local m = Instance.new("Message", game.Workspace)
  113. m.Text = "OH NO! THE PLANE IS LOSING CONTROL!"
  114. launch.Value = true
  115. wait(5)
  116. m:remove()
  117. local h = Instance.new("Hint", game.Workspace)
  118. h.Text = "The plane is about to crash into an island!"
  119. explosionv.Value = math.random(1,3)
  120.  
  121. repeat
  122. wait()
  123. until timesup == true
  124. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  125.  
  126. h.Text = "Oh well, this happened many times already, the next plane will arrive soon."
  127. boss:Stop()
  128. launch.Value = false
  129. explosionv.Value = 0
  130. plane:remove()
  131. wait(5)
  132. h:remove()
  133. local newplane = planemodel:Clone()
  134. newplane.Parent = game.Workspace
  135. newplane:MakeJoints()
  136. else
  137. local m = Instance.new("Message", game.Workspace)
  138. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  139. game.Workspace:FindFirstChild("Plane"):remove()
  140. wait(5)
  141. m:remove()
  142. local newplane = planemodel:Clone()
  143. newplane.Parent = game.Workspace
  144. newplane:MakeJoints()
  145.  
  146. hasglitched.Value = false -- reset the value to continue debugging
  147. end
  148. end
  149.  
  150. if chosenevent == "Terrorist" then
  151. if hasglitched.Value == false then
  152. glitchdetector.Disabled = true
  153.  
  154. local routine = coroutine.create(setEventTime)
  155. coroutine.resume(routine, 100)
  156.  
  157. local plane = game.Workspace:FindFirstChild("Plane")
  158. for i,v in pairs(plane:FindFirstChild("Terrorist"):GetChildren()) do
  159. if v:IsA("Part") then
  160. v.Transparency = 0
  161. if v.Name == "Head" then
  162. --v.face.Transparency = 0
  163. end
  164. elseif v:IsA("Hat") then
  165. v.Handle.Transparency = 0
  166. end
  167. end
  168.  
  169. local m = Instance.new("Message", game.Workspace)
  170. launch.Value = true
  171. boss:Play()
  172. m.Text = "THERE IS A TERRORIST ON THE PLANE!!"
  173. wait(3)
  174. m.Text = "Terrorist: ALLAHU AKBAR!!!"
  175. wait(1)
  176. m:remove()
  177. boss:Stop()
  178. local terrorist = plane:FindFirstChild("Terrorist")
  179. if terrorist and terrorist:FindFirstChild("Torso") then
  180. local h = Instance.new("Hint", game.Workspace)
  181. h.Text = "THE TERRORIST HAS EXPLODED THE PLANE!!"
  182. local explosion = Instance.new("Explosion", plane:FindFirstChild("Terrorist").Torso)
  183. explosion.BlastRadius = 1000
  184. explosion.BlastPressure = 500000
  185. explosion.Position = plane:FindFirstChild("Terrorist").Torso.Position
  186. game.Debris:AddItem(explosion, 5)
  187. isisexplosion:Play()
  188. isis:Play()
  189.  
  190. repeat
  191. wait()
  192. until timesup == true
  193. coroutine.yield(routine) -- without yield, the coroutine will not be able to restart (aka dead forever)
  194. h.Text = "Hopefully next time, we will check our passengers more carefully."
  195. isis:Stop()
  196. isisexplosion:Stop()
  197. launch.Value = false
  198. plane:remove()
  199. wait(5)
  200. h:remove()
  201. local newplane = planemodel:Clone()
  202. newplane.Parent = game.Workspace
  203. newplane:MakeJoints()
  204.  
  205. else
  206.  
  207. local m = Instance.new("Message", game.Workspace)
  208. m.Text = "SERVER: Something went wrong with the current event, reseting game..."
  209. plane:remove()
  210. wait(5)
  211. m:remove()
  212. local newplane = planemodel:Clone()
  213. newplane.Parent = game.Workspace
  214. newplane:MakeJoints()
  215. end
  216.  
  217. else
  218. local m = Instance.new("Message", game.Workspace)
  219. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  220. game.Workspace:FindFirstChild("Plane"):remove()
  221. wait(5)
  222. m:remove()
  223. local newplane = planemodel:Clone()
  224. newplane.Parent = game.Workspace
  225. newplane:MakeJoints()
  226.  
  227. hasglitched.Value = false -- reset the value to continue debugging
  228. end
  229. end
  230.  
  231. if chosenevent == "Fire" then
  232. if hasglitched.Value == false then
  233. glitchdetector.Disabled = true
  234.  
  235. local routine = coroutine.create(setEventTime)
  236. coroutine.resume(routine, 120)
  237.  
  238. local m = Instance.new("Message", game.Workspace)
  239. m.Text = "Uh oh, the plane's engine seems to be overheating."
  240. wait(3)
  241. m.Text = "IT'S BURNING, THE PLANE IS ON FIRE!!"
  242. launch.Value = true
  243. boss:Play()
  244. firenoise:Play()
  245. local plane = game.Workspace:FindFirstChild("Plane")
  246. if plane == nil then return end
  247. local jet = plane.Black:FindFirstChild("Jet")
  248. delay(0, function()
  249. for i,x in pairs(game.Workspace:FindFirstChild("Plane"):GetChildren()) do
  250. if x:IsA("BasePart") then
  251. x.BrickColor = BrickColor.new("Really red")
  252. x.Material = "CorrodedMetal"
  253. x.Touched:connect(function(p)
  254. if p and p.Parent then
  255. local hum = p.Parent:FindFirstChild("Humanoid")
  256. if hum ~= nil then
  257. hum:TakeDamage(1)
  258. end
  259. end
  260. end)
  261. game.Debris:AddItem(x, 30)
  262. wait()
  263. elseif x:IsA("Model") then
  264. for i,y in pairs(x:GetChildren()) do
  265. if y:IsA("BasePart") then
  266. y.BrickColor = BrickColor.new("Really red")
  267. y.Material = "CorrodedMetal"
  268. y.Touched:connect(function(p)
  269. if p and p.Parent then
  270. local hum = p.Parent:FindFirstChild("Humanoid")
  271. if hum ~= nil then
  272. hum:TakeDamage(1)
  273. end
  274. end
  275. end)
  276. game.Debris:AddItem(y, 30)
  277. wait()
  278. end
  279. end
  280. end
  281. end
  282. end)
  283.  
  284. wait(2)
  285. m:remove()
  286. h = Instance.new("Hint", game.Workspace)
  287. h.Text = "The plane is burning, try to save yourself!"
  288. wait(30)
  289. firenoise.Volume = 0.25
  290.  
  291. repeat
  292. wait()
  293. until timesup == true
  294. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  295. h.Text = "Next time we should bring a bucket of water on the plane if this happens again..."
  296. boss:Stop()
  297. firenoise.Volume = 0.1
  298. launch.Value = false
  299. plane:remove()
  300. wait(5)
  301. h:remove()
  302. firenoise:Stop()
  303. local newplane = planemodel:Clone()
  304. newplane.Parent = game.Workspace
  305. newplane:MakeJoints()
  306.  
  307. else
  308. local m = Instance.new("Message", game.Workspace)
  309. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  310. game.Workspace:FindFirstChild("Plane"):remove()
  311. wait(5)
  312. m:remove()
  313. local newplane = planemodel:Clone()
  314. newplane.Parent = game.Workspace
  315. newplane:MakeJoints()
  316.  
  317. hasglitched.Value = false -- reset the value to continue debugging
  318. end
  319. end
  320.  
  321. if chosenevent == "Trump" then
  322. if hasglitched.Value == false then
  323. glitchdetector.Disabled = true
  324.  
  325. local routine = coroutine.create(setEventTime)
  326. coroutine.resume(routine, 60) -- cannot put in decimal because the setEventTime() function only minus the time by 1
  327.  
  328. local wall = game.Lighting.BorderWall:Clone()
  329. local plane = game.Workspace:FindFirstChild("Plane")
  330. local center = plane.PlaneCenterPart
  331. if plane ~= nil and center ~= nil and conveyor ~= nil then
  332. launch.Value = true
  333. conveyor.Value = true
  334. local bv = Instance.new("BodyVelocity", center)
  335. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  336. bv.velocity = Vector3.new(750,0,0)
  337. game.Debris:AddItem(bv, 16)
  338. wall.Parent = game.Workspace
  339. local m = Instance.new("Message", game.Workspace)
  340. m.Text = "The plane is taking off!"
  341. wait(3)
  342. m:remove()
  343. wait(5)
  344. local m = Instance.new("Message", game.Workspace)
  345. m.Text = "Wait I haven't noticed, what is that thing in the distance?"
  346. wait(8)
  347. m.Text = "It is Trump's border wall! The plane is flying straight into it and can't be stopped!"
  348. trump:Play()
  349. wait(7)
  350. m:remove()
  351. local h = Instance.new("Hint", game.Workspace)
  352. h.Text = "THE PLANE HAS CRASHED INTO TRUMP'S BORDER WALL!"
  353. conveyor.Value = false
  354.  
  355. repeat
  356. wait()
  357. until timesup == true
  358. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  359. trump:Stop()
  360. h.Text = "That wall really needs to be destroyed..."
  361. wall:remove()
  362. launch.Value = false
  363. plane:remove()
  364. wait(5)
  365. h:remove()
  366. local newplane = planemodel:Clone()
  367. newplane.Parent = game.Workspace
  368. newplane:MakeJoints()
  369. else
  370. local m = Instance.new("Message", game.Workspace)
  371. m.Text = "SERVER: Something went wrong with the current event, reseting game..."
  372. plane:remove()
  373. wait(5)
  374. m:remove()
  375. local newplane = planemodel:Clone()
  376. newplane.Parent = game.Workspace
  377. newplane:MakeJoints()
  378. end
  379.  
  380. else
  381. local m = Instance.new("Message", game.Workspace)
  382. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  383. game.Workspace:FindFirstChild("Plane"):remove()
  384. wait(5)
  385. m:remove()
  386. local newplane = planemodel:Clone()
  387. newplane.Parent = game.Workspace
  388. newplane:MakeJoints()
  389.  
  390. hasglitched.Value = false -- reset the value to continue debugging
  391. end
  392. end
  393.  
  394. if chosenevent == "Tornado" then
  395. if hasglitched.Value == false then
  396. glitchdetector.Disabled = true
  397.  
  398. local routine = coroutine.create(setEventTime)
  399. coroutine.resume(routine, 120)
  400.  
  401. local originaltime = game.Lighting.TimeOfDay
  402. local originalambient = game.Lighting.Ambient
  403.  
  404. local plane = game.Workspace:FindFirstChild("Plane")
  405. local tornado = game.Lighting.Tornado:Clone()
  406. local cloud = game.Lighting.StormyCloud:Clone()
  407. local m = Instance.new("Message", game.Workspace)
  408. cloud.Parent = game.Workspace
  409. m.Text = "The weather is a very windy and foggy at the moment..."
  410. heavywind:Play()
  411. launch.Value = true
  412. conveyor.Value = true
  413. game.Lighting.TimeOfDay = "18:15:00"
  414. game.Lighting.Ambient = Color3.new(0.3, 0.3, 0.3)
  415. wait(5)
  416. m:remove()
  417. tornado.Parent = game.Workspace
  418. tornadowind:Play()
  419. wait(5)
  420. local m = Instance.new("Message", game.Workspace)
  421. m.Text = "What is that spinning thing in the distance? It's too blury."
  422. wait(5)
  423. m.Text = "IT'S ACTUALLY A TORNADO! THE PLANE IS BEING SUCKED INTO IT!"
  424. boss:Play()
  425. wait(2.5)
  426. m:remove()
  427. local h = Instance.new("Hint", game.Workspace)
  428. h.Text = "The plane got destroyed by the tornado! Survive the fall!"
  429. conveyor.Value = false
  430.  
  431. repeat
  432. wait()
  433. until timesup == true
  434. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  435. h.Text = "Next time we should check the weather forecast before flying..."
  436. boss:Stop()
  437. launch.Value = false
  438. plane:remove()
  439. wait(5)
  440. h:remove()
  441. heavywind:Stop()
  442. tornadowind:Stop()
  443. tornado:remove()
  444. cloud:remove()
  445. game.Lighting.Ambient = originalambient
  446. game.Lighting.TimeOfDay = originaltime
  447. local newplane = planemodel:Clone()
  448. newplane.Parent = game.Workspace
  449. newplane:MakeJoints()
  450.  
  451. else
  452. local m = Instance.new("Message", game.Workspace)
  453. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  454. game.Workspace:FindFirstChild("Plane"):remove()
  455. wait(5)
  456. m:remove()
  457. local newplane = planemodel:Clone()
  458. newplane.Parent = game.Workspace
  459. newplane:MakeJoints()
  460.  
  461. hasglitched.Value = false -- reset the value to continue debugging
  462. end
  463. end
  464.  
  465. if chosenevent == "Lightning" then
  466. if hasglitched.Value == false then
  467. glitchdetector.Disabled = true
  468.  
  469. local routine = coroutine.create(setEventTime)
  470. coroutine.resume(routine, 120)
  471.  
  472. local originaltime = game.Lighting.TimeOfDay
  473. local originalambient = game.Lighting.Ambient
  474.  
  475. local plane = game.Workspace:FindFirstChild("Plane")
  476. local bolt = game.Lighting.LightningBolt:Clone()
  477. local bolt2 = game.Lighting.LightningBolt:Clone()
  478. local cloud = game.Lighting.StormyCloud:Clone()
  479. cloud.Parent = game.Workspace
  480. local m = Instance.new("Message", game.Workspace)
  481. m.Text = "It's raining heavily right now, let's hope nothing will go wrong in our flight."
  482. rain:Play()
  483. launch.Value = true
  484. conveyor.Value = true
  485. game.Lighting.TimeOfDay = "18:15:00"
  486. game.Lighting.Ambient = Color3.new(0.3, 0.3, 0.3)
  487. wait(6)
  488. local l1 = plane:FindFirstChild("Bright red").lightning1
  489. bolt.Parent = game.Workspace
  490. bolt.Position = l1.Position + Vector3.new(0, (bolt.Size/2), 0)
  491. local explosion = Instance.new("Explosion", l1)
  492. explosion.BlastPressure = 999999999
  493. explosion.BlastRadius = 15
  494. explosion.Position = l1.Position
  495. game.Debris:AddItem(explosion, 5)
  496. thunder:Play()
  497. wait(0.5)
  498. bolt:remove()
  499. boss:Play()
  500. conveyor.Value = false
  501. m.Text = "THE PLANE IS GETTING HIT BY LIGHTNING!"
  502. wait(2)
  503. m:remove()
  504. local l2 = plane:FindFirstChild("Bright red").lightning2
  505. bolt2.Parent = game.Workspace
  506. bolt2.Position = l2.Position + Vector3.new(0, (bolt2.Size/2), 0)
  507. local explosion2 = Instance.new("Explosion", l2)
  508. explosion.BlastPressure = 999999999
  509. explosion2.BlastRadius = 15
  510. explosion2.Position = l2.Position
  511. game.Debris:AddItem(explosion2, 5)
  512. thunder:Play()
  513. local h = Instance.new("Hint", game.Workspace)
  514. h.Text = "The plane got hit twice and lost control, it's now falling down!"
  515. wait(0.5)
  516. bolt2:remove()
  517.  
  518. repeat
  519. wait()
  520. until timesup == true
  521. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  522. h.Text = "Next time we should check the weather forecast before flying..."
  523. launch.Value = false
  524. boss:Stop()
  525. plane:remove()
  526. wait(5)
  527. h:remove()
  528. rain:Stop()
  529. cloud:remove()
  530. game.Lighting.Ambient = originalambient
  531. game.Lighting.TimeOfDay = originaltime
  532. local newplane = planemodel:Clone()
  533. newplane.Parent = game.Workspace
  534. newplane:MakeJoints()
  535.  
  536. else
  537. local m = Instance.new("Message", game.Workspace)
  538. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  539. game.Workspace:FindFirstChild("Plane"):remove()
  540. wait(5)
  541. m:remove()
  542. local newplane = planemodel:Clone()
  543. newplane.Parent = game.Workspace
  544. newplane:MakeJoints()
  545.  
  546. hasglitched.Value = false -- reset the value to continue debugging
  547. end
  548. end
  549.  
  550. if chosenevent == "Nuke" then
  551. if hasglitched.Value == false then
  552. glitchdetector.Disabled = true
  553.  
  554. local routine = coroutine.create(setEventTime)
  555. coroutine.resume(routine, 80)
  556.  
  557. local plane = game.Workspace:FindFirstChild("Plane")
  558. local nuke = game.Lighting.Nuke:Clone()
  559. nuke.Parent = plane
  560. nuke:MakeJoints()
  561.  
  562. local center = nuke.Parts.Center
  563. local exvalue = nuke.Explode
  564. local smallboom = nuke.SmallBoom
  565. local boom = nuke.Boom
  566. local rocket = nuke.RocketBoom
  567.  
  568. launch.Value = true
  569. conveyor.Value = true
  570. wait(5)
  571. local m = Instance.new("Message", game.Workspace)
  572. m.Text = "What's that? People are complaining about something..."
  573. wait(7)
  574. boss:Play()
  575. m.Text = "THERE'S A MASSIVE NUKE INSIDE THE PLANE'S STORAGE?!?!"
  576. wait(6)
  577. conveyor.Value = false
  578. m:remove()
  579.  
  580. delay(0, function()
  581. if plane:FindFirstChild("Nuke") ~= nil then
  582. local part = Instance.new("Part", game.Workspace)
  583. part.Name = "NukeExplosion"
  584. part.Shape = "Ball"
  585. part.Size = Vector3.new(4,4,4)
  586. part.TopSurface = "Smooth"
  587. part.BottomSurface = "Smooth"
  588. part.BrickColor = BrickColor.Yellow()
  589. part.CanCollide = false
  590. part.Anchored = true
  591. part.Transparency = 0.3
  592. part.CFrame = center.CFrame
  593.  
  594. local ring = Instance.new("Part", game.Workspace)
  595. ring.Name = "NukeRing"
  596. ring.BrickColor = BrickColor.White()
  597. ring.Size = Vector3.new(8,8,2)
  598. ring.CanCollide = false
  599. ring.Anchored = true
  600. ring.CFrame = center.CFrame
  601. local mesh = Instance.new("SpecialMesh", ring)
  602. mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  603. mesh.Scale = Vector3.new(10,10,0.25)
  604.  
  605. local currentpos = center.CFrame
  606.  
  607. local newboom = boom:Clone()
  608. newboom.Parent = game.Workspace
  609. newboom:Play()
  610. game.Debris:AddItem(newboom, 10)
  611.  
  612. local explosion = Instance.new("Explosion", center)
  613. explosion.BlastRadius = 1000
  614. explosion.Position = center.Position
  615.  
  616. wait(1)
  617.  
  618. local newsmallboom = smallboom:Clone()
  619. newsmallboom.Parent = game.Workspace
  620. newsmallboom:Play()
  621. game.Debris:AddItem(newsmallboom, 10)
  622.  
  623. local newrocket = rocket:Clone()
  624. newrocket.Parent = game.Workspace
  625. newrocket:Play()
  626. game.Debris:AddItem(newrocket, 10)
  627.  
  628. --[[part.Touched:connect(function(p)
  629. if p:IsA("BasePart") then
  630. p.BrickColor = BrickColor.new("Black")
  631. p.Material = "Slate"
  632. p.Material = "CorrodedMetal"
  633. p:BreakJoints()
  634. end
  635. end)]]--
  636.  
  637. for i,x in pairs(game.Workspace:FindFirstChild("Plane"):GetChildren()) do
  638. if x:IsA("BasePart") then
  639. x.BrickColor = BrickColor.new("Black")
  640. x.Material = "CorrodedMetal"
  641. elseif x:IsA("Model") then
  642. for i,y in pairs(x:GetChildren()) do
  643. if y:IsA("BasePart") then
  644. y.BrickColor = BrickColor.new("Black")
  645. y.Material = "CorrodedMetal"
  646. end
  647. end
  648. end
  649. end
  650.  
  651. local h = Instance.new("Hint", game.Workspace)
  652. h.Text = "THE NUKE EXPLODED AND EVERYTHING ON THE PLANE GOT INCINERATED!"
  653.  
  654. for i = 1,100 do
  655. part.Size = part.Size + Vector3.new(4,4,4)
  656. mesh.Scale = mesh.Scale + Vector3.new(6,6,0)
  657. part.CFrame = currentpos
  658. ring.CFrame = currentpos
  659. wait()
  660. end
  661.  
  662. for i = 1,10 do
  663. part.Transparency = part.Transparency + 0.1
  664. ring.Transparency = ring.Transparency + 0.1
  665. wait(0.1)
  666. end
  667. part:remove()
  668. ring:remove()
  669. else
  670. boss:Stop()
  671. local m = Instance.new("Message", game.Workspace)
  672. m.Text = "SERVER: Something went wrong with the current event, reseting game..."
  673. plane:remove()
  674. wait(5)
  675. m:remove()
  676. local newplane = planemodel:Clone()
  677. newplane.Parent = game.Workspace
  678. newplane:MakeJoints()
  679. end
  680. end)
  681.  
  682. repeat
  683. wait()
  684. until timesup == true
  685. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  686.  
  687. h.Text = "Next time we will check people's luggage more carefully, just hopefully..."
  688. launch.Value = false
  689. plane:remove()
  690. wait(5)
  691. h:remove()
  692. boss:Stop()
  693. local newplane = planemodel:Clone()
  694. newplane.Parent = game.Workspace
  695. newplane:MakeJoints()
  696. else
  697. local m = Instance.new("Message", game.Workspace)
  698. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  699. game.Workspace:FindFirstChild("Plane"):remove()
  700. wait(5)
  701. m:remove()
  702. local newplane = planemodel:Clone()
  703. newplane.Parent = game.Workspace
  704. newplane:MakeJoints()
  705.  
  706. hasglitched.Value = false -- reset the value to continue debugging
  707. end
  708. end
  709.  
  710. if chosenevent == "90s" then
  711. if hasglitched.Value == false then
  712. glitchdetector.Disabled = true
  713.  
  714. local routine = coroutine.create(setEventTime)
  715. coroutine.resume(routine, 80)
  716.  
  717. local plane = game.Workspace:FindFirstChild("Plane")
  718. local center = plane.PlaneCenterPart
  719. local wall = game.Lighting.BorderWall:Clone()
  720. local originalambient = game.Lighting.Ambient
  721. local m = Instance.new("Message", game.Workspace)
  722. m.Text = "The plane is going to take off in a few moments, please wait..."
  723. wall.Parent = game.Workspace
  724. wait(5)
  725. running90s:Play()
  726. m.Text = "What's that song? No way... Could it be?..."
  727. wait(3)
  728. m.Text = "OH GOD, IT'S RUNNING IN THE 90's! THAT SONG IS TOO..."
  729. wait(3)
  730. if center ~= nil then
  731. m:remove()
  732. local h = Instance.new("Hint", game.Workspace)
  733. h.Text = "The plane went flying at super sonic speed and crashed into Trump's border wall... again!"
  734. local bv = Instance.new("BodyVelocity", center)
  735. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  736. bv.velocity = Vector3.new(7500,0,0)
  737. game.Debris:AddItem(center, 15)
  738. sonic:Play()
  739.  
  740. repeat
  741. game.Lighting.Ambient = Color3.new(math.random(255)/255, math.random(255)/255, math.random(255)/255)
  742. wait(0.3773584)
  743. until timesup == true
  744. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  745.  
  746. running90s:Stop()
  747. game.Lighting.Ambient = originalambient
  748. h.Text = "Next time we will kick out anyone who play that song on the plane..."
  749. plane:remove()
  750. wait(5)
  751. h:remove()
  752. wall:remove()
  753. local newplane = planemodel:Clone()
  754. newplane.Parent = game.Workspace
  755. newplane:MakeJoints()
  756. else
  757. running90s:Stop()
  758. local m = Instance.new("Message", game.Workspace)
  759. m.Text = "SERVER: Something went wrong with the current event, reseting game..."
  760. plane:remove()
  761. wait(5)
  762. m:remove()
  763. local newplane = planemodel:Clone()
  764. newplane.Parent = game.Workspace
  765. newplane:MakeJoints()
  766. end
  767. else
  768. local m = Instance.new("Message", game.Workspace)
  769. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  770. game.Workspace:FindFirstChild("Plane"):remove()
  771. wait(5)
  772. m:remove()
  773. local newplane = planemodel:Clone()
  774. newplane.Parent = game.Workspace
  775. newplane:MakeJoints()
  776.  
  777. hasglitched.Value = false -- reset the value to continue debugging
  778. end
  779. end
  780.  
  781. if chosenevent == "Shoop Da Woop" then
  782. if hasglitched.Value == false then
  783. glitchdetector.Disabled = true
  784.  
  785. local routine = coroutine.create(setEventTime)
  786. coroutine.resume(routine, 100)
  787.  
  788. local shooptrigger = triggers.ShoopDaWoopTrigger
  789. local plane = game.Workspace:FindFirstChild("Plane")
  790. local center = plane:FindFirstChild("PlaneCenterPart")
  791.  
  792. launch.Value = true
  793. conveyor.Value = true
  794. wait(5)
  795. local m = Instance.new("Message", game.Workspace)
  796. m.Text = "It's a beautiful day, isn't it? It's pretty quiet too."
  797. dubstep:Play()
  798. wait(5)
  799. m.Text = "Okay, I take that back. What's that noise?"
  800. dubstep.Volume = 0.5
  801. wait(5.2)
  802. m.Text = "OH GOD! IT'S SHOOP DA WOOP!!!"
  803. lazor:Play()
  804.  
  805. local shoop = game.Lighting.ShoopDaWoop:Clone()
  806. shoop.CFrame = CFrame.new(center.Position) * CFrame.new(50, 0, 150) * CFrame.Angles(0, math.rad(0), 0) -- :O putting the angles in the middle is different than putting it at the end! that's why cframe is so confusing
  807. shoop.Parent = game.Workspace
  808. wait(3.75)
  809. m:remove()
  810.  
  811. local h = Instance.new("Hint", game.Workspace)
  812. h.Text = "SHOOP DA WOOP HAS PWNED THE PLANE!"
  813.  
  814. conveyor.Value = false
  815.  
  816. local beam = Instance.new("Part")
  817. beam.Name = "LAZORBEAM"
  818. beam.BrickColor = BrickColor.new("Cyan")
  819. beam.Size = Vector3.new(25, 9999, 25)
  820. beam.CanCollide = false
  821. beam.Anchored = true
  822. beam.TopSurface = "Smooth"
  823. beam.BottomSurface = "Smooth"
  824. beam.Reflectance = 0.5
  825. beam.CFrame = CFrame.Angles(math.rad(90),0,0) * CFrame.new(shoop.Position - Vector3.new(0,0,(beam.Size.Y/2)) - Vector3.new(0,0,0.5))
  826. beam.Parent = game.Workspace
  827. local mesh = Instance.new("CylinderMesh", beam)
  828.  
  829. beam.Touched:connect(function(p)
  830. if p.Anchored == false and p.CanCollide == true then
  831. local explosion = Instance.new("Explosion", p)
  832. explosion.BlastRadius = 15
  833. explosion.Position = p.Position
  834. game.Debris:AddItem(explosion, 3)
  835. end
  836. end)
  837.  
  838. delay(0, function()
  839. for i = 1, 100 do -- this one doesn't use setEventTime() too
  840. beam.Size = Vector3.new(25,9999,25)
  841. beam.CFrame = CFrame.Angles(math.rad(90),0,0) + (shoop.Position - Vector3.new(0,0,(beam.Size.Y/2)))
  842. wait()
  843. beam.Size = Vector3.new(27.5,9999,27.5)
  844. beam.CFrame = CFrame.Angles(math.rad(90),0,0) + (shoop.Position - Vector3.new(0,0,(beam.Size.Y/2)))
  845. --beam.CFrame = CFrame.fromEulerAnglesXYZ(math.rad(90),0,0)
  846. wait()
  847. beam.Size = Vector3.new(30,9999,30)
  848. beam.CFrame = CFrame.Angles(math.rad(90),0,0) + (shoop.Position - Vector3.new(0,0,(beam.Size.Y/2)))
  849. --beam.CFrame = CFrame.fromEulerAnglesXYZ(math.rad(90),0,0)
  850. wait()
  851. beam.Size = Vector3.new(27.5,9999,27.5)
  852. beam.CFrame = CFrame.Angles(math.rad(90),0,0) + (shoop.Position - Vector3.new(0,0,(beam.Size.Y/2)))
  853. --beam.CFrame = CFrame.fromEulerAnglesXYZ(math.rad(90),0,0)
  854. wait()
  855. end
  856.  
  857. for i = 1,10 do
  858. beam.Transparency = beam.Transparency + 0.1
  859. wait()
  860. end
  861. wait(2)
  862. for i = 1,10 do
  863. shoop.Transparency = shoop.Transparency + 0.1
  864. wait()
  865. end
  866. beam:remove()
  867. shoop:remove()
  868. end)
  869.  
  870. repeat
  871. wait()
  872. until timesup == true
  873. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  874.  
  875. dubstep:Stop()
  876. launch.Value = false
  877. h.Text = "Maybe it's not really that beautiful when seeing that thing..."
  878. plane:remove()
  879. wait(5)
  880. h:remove()
  881. local newplane = planemodel:Clone()
  882. newplane.Parent = game.Workspace
  883. newplane:MakeJoints()
  884.  
  885. else
  886. local m = Instance.new("Message", game.Workspace)
  887. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  888. game.Workspace:FindFirstChild("Plane"):remove()
  889. wait(5)
  890. m:remove()
  891. local newplane = planemodel:Clone()
  892. newplane.Parent = game.Workspace
  893. newplane:MakeJoints()
  894.  
  895. hasglitched.Value = false -- reset the value to continue debugging
  896. end
  897. end
  898.  
  899. if chosenevent == "Sanic" then
  900. if hasglitched.Value == false then
  901. glitchdetector.Disabled = true
  902.  
  903. local routine = coroutine.create(setEventTime)
  904. coroutine.resume(routine, 120)
  905.  
  906. local sanictrigger = triggers.SanicTrigger
  907. local plane = game.Workspace:FindFirstChild("Plane")
  908. local center = plane.PlaneCenterPart
  909.  
  910. launch.Value = true
  911. conveyor.Value = true
  912. normalexplosion.Volume = 0.2
  913. local m = Instance.new("Message", game.Workspace)
  914. m.Text = "The plane is now taking off..."
  915.  
  916. wait(2)
  917. m.Text = "Why does it looks like the plane is going slower than usual?"
  918. wait(5)
  919. tooslow:Play()
  920. wait(1.5)
  921. m.Text = "That voice sounds familier..."
  922. wait(1.5)
  923. sanics:Play()
  924. m.Text = "OH MY GOD, IT'S SANIC DE HEDGEHOG!"
  925. -- before i didn't use CFrame, which was pretty dumb
  926. sanic = game.Lighting.Sanic:Clone()
  927. sanic.CFrame = CFrame.new(center.Position) * CFrame.new(0, 0, -150)
  928. sanic.Parent = game.Workspace
  929.  
  930. local bv = Instance.new("BodyVelocity", sanic)
  931. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  932. bv.velocity = Vector3.new(0, 0, 500)
  933. local bg = Instance.new("BodyGyro", sanic)
  934. bg.maxTorque = Vector3.new(999999,999999,999999)
  935. bg.cframe = CFrame.Angles(0,math.rad(90),0)
  936. wait(2.5)
  937. m:remove()
  938. conveyor.Value = false
  939.  
  940. local h = Instance.new("Hint", game.Workspace)
  941. h.Text = "SANIC HAS CUT THE PLANE INTO HALF!"
  942.  
  943. repeat
  944. wait()
  945. until timesup == true
  946. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  947. sanics:Stop()
  948. sanic:remove()
  949. h.Text = "He was just too fast."
  950. normalexplosion.Volume = 0.5
  951. plane:remove()
  952. wait(5)
  953. h:remove()
  954. local newplane = planemodel:Clone()
  955. newplane.Parent = game.Workspace
  956. newplane:MakeJoints()
  957.  
  958. else
  959. local m = Instance.new("Message", game.Workspace)
  960. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  961. game.Workspace:FindFirstChild("Plane"):remove()
  962. wait(5)
  963. m:remove()
  964. local newplane = planemodel:Clone()
  965. newplane.Parent = game.Workspace
  966. newplane:MakeJoints()
  967.  
  968. hasglitched.Value = false -- reset the value to continue debugging
  969. end
  970. end
  971.  
  972. if chosenevent == "Nyan Cat" then
  973. if hasglitched.Value == false then
  974. glitchdetector.Disabled = true
  975.  
  976. local routine = coroutine.create(setEventTime)
  977. coroutine.resume(routine, 100)
  978.  
  979. local plane = game.Workspace:FindFirstChild("Plane")
  980. local center = plane:FindFirstChild("PlaneCenterPart")
  981. local rainbow = game.Lighting.Rainbow:Clone()
  982. rainbow.Parent = game.Workspace
  983. local nyancat = game.Lighting.NyanCat:Clone()
  984. nyancat.CFrame = CFrame.new(Vector3.new(rainbow:FindFirstChild("Cloud").Position.X, center.Position.Y + 5, center.Position.Z)) * CFrame.Angles(0, math.rad(0), 0)
  985. nyancat.Parent = game.Workspace
  986. launch.Value = true
  987. conveyor.Value = true
  988. normalexplosion.Volume = 0.2
  989. wait(5)
  990. local m = Instance.new("Message", game.Workspace)
  991. m.Text = "Oh wow! There is a very beautiful rainbow in front of us!"
  992. wait(5)
  993. m.Text = "Wait, something is coming out..."
  994. wait(3)
  995. m.Text = "IT'S THE NYAN CAT! IT'S FLYING STRAIGHT TOWARDS THE PLANE!"
  996. nyans:Play()
  997. local bv = Instance.new("BodyVelocity", nyancat)
  998. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  999. bv.velocity = Vector3.new(-1250,0,0)
  1000. nyancat.Anchored = false
  1001.  
  1002. wait(3)
  1003. m:remove()
  1004. local h = Instance.new("Hint", game.Workspace)
  1005. h.Text = "Nyan Cat barraged through the plane!"
  1006. conveyor.Value = false
  1007.  
  1008. repeat
  1009. wait()
  1010. until timesup == true
  1011. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  1012. nyans:Stop()
  1013. nyancat:remove()
  1014. rainbow:remove()
  1015. h.Text = "I don't like rainbows anymore..."
  1016. normalexplosion.Volume = 0.5
  1017. launch.Value = false
  1018. plane:remove()
  1019. wait(5)
  1020. h:remove()
  1021. local newplane = planemodel:Clone()
  1022. newplane.Parent = game.Workspace
  1023. newplane:MakeJoints()
  1024.  
  1025. else
  1026. local m = Instance.new("Message", game.Workspace)
  1027. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  1028. game.Workspace:FindFirstChild("Plane"):remove()
  1029. wait(5)
  1030. m:remove()
  1031. local newplane = planemodel:Clone()
  1032. newplane.Parent = game.Workspace
  1033. newplane:MakeJoints()
  1034.  
  1035. hasglitched.Value = false -- reset the value to continue debugging
  1036. end
  1037. end
  1038.  
  1039. if chosenevent == "Raining Bomb" then
  1040. if hasglitched.Value == false then
  1041. glitchdetector.Disabled = true
  1042.  
  1043. local routine = coroutine.create(setEventTime)
  1044. coroutine.resume(routine, 120)
  1045.  
  1046. local plane = game.Workspace:FindFirstChild("Plane")
  1047. local m = Instance.new("Message", game.Workspace)
  1048. m.Text = "I hear some plane noises, they are doing something above us."
  1049. wait(5)
  1050. m.Text = "OMG, IT'S RAINING BOMB FROM THE SKY!!"
  1051. boss:Play()
  1052. launch.Value = true
  1053. wait(5)
  1054. m:remove()
  1055. local h = Instance.new("Hint", game.Workspace)
  1056. h.Text = "Survive the bomb attack!"
  1057. delay(0, function()
  1058. for i = 1, 200 do -- total wait time is from 60 to 100 seconds
  1059. local bomb = game.Lighting.Bomb:Clone()
  1060. bomb.CFrame = CFrame.Angles(math.rad(-90), math.rad(math.random(-180,180)), 0) + Vector3.new(math.random(-500, 250), math.random(1500,3000), math.random(-500, 1000))
  1061. game.Debris:AddItem(bomb, 30)
  1062.  
  1063. local bv = Instance.new("BodyVelocity", bomb)
  1064. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  1065. bv.velocity = Vector3.new(0, -500, 0)
  1066. bomb.Parent = game.Workspace
  1067. wait(math.random(0.3, 0.5))
  1068. end
  1069. h.Text = "The bomb rain has stopped..."
  1070. end)
  1071.  
  1072. repeat
  1073. wait()
  1074. until timesup == true
  1075. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  1076. h.Text = "I blame North Korea to be behind all of this..."
  1077. boss:Stop()
  1078. launch.Value = false
  1079. plane:remove()
  1080. wait(5)
  1081. h:remove()
  1082. local newplane = planemodel:Clone()
  1083. newplane.Parent = game.Workspace
  1084. newplane:MakeJoints()
  1085.  
  1086. else
  1087. local m = Instance.new("Message", game.Workspace)
  1088. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  1089. game.Workspace:FindFirstChild("Plane"):remove()
  1090. wait(5)
  1091. m:remove()
  1092. local newplane = planemodel:Clone()
  1093. newplane.Parent = game.Workspace
  1094. newplane:MakeJoints()
  1095.  
  1096. hasglitched.Value = false -- reset the value to continue debugging
  1097. end
  1098. end
  1099.  
  1100. if chosenevent == "Fidget Spinner" then
  1101. if hasglitched.Value == false then
  1102. glitchdetector.Disabled = true
  1103.  
  1104. local routine = coroutine.create(setEventTime)
  1105. coroutine.resume(routine, 90)
  1106.  
  1107. normalexplosion.Volume = 0.07
  1108.  
  1109. local plane = game.Workspace:FindFirstChild("Plane")
  1110. local center = plane.PlaneCenterPart
  1111. local smallspinner = game.Lighting.SmallFidgetSpinner:Clone()
  1112. local spinnergroup = game.Lighting.FidgetSpinnerGroup:Clone()
  1113. smallspinner.Parent = game.Workspace
  1114. smallspinner:MakeJoints()
  1115. wait(1)
  1116. local m = Instance.new("Message", game.Workspace)
  1117. m.Text = "WHAT THE...?! THE PLANE JUST GOT HIT BY A FIDGET SPINNER!"
  1118. fidgets:Play()
  1119.  
  1120. local bv = Instance.new("BodyForce", center)
  1121. bv.force = Vector3.new(1000000,-1000000,0)
  1122. wait(4)
  1123. m.Text = "AND BELOW THERE ARE EVEN MORE FIDGET SPINNERS!!"
  1124. spinnergroup.Parent = game.Workspace
  1125. spinnergroup:MakeJoints()
  1126. launch.Value = true
  1127. wait(3)
  1128. m:remove()
  1129. local h = Instance.new("Hint", game.Workspace)
  1130. h.Text = "The plane is getting destroyed by the fidget spinners!"
  1131.  
  1132. repeat
  1133. wait()
  1134. until timesup == true
  1135. coroutine.yield(routine) -- if you don't yield, the coroutine will not be able to restart (aka dead forever)
  1136. h.Text = "I wish fidget spinners never existed."
  1137. smallspinner:remove()
  1138. spinnergroup:remove()
  1139. launch.Value = false
  1140. plane:remove()
  1141. wait(5)
  1142. h:remove()
  1143. fidgets:Stop()
  1144. normalexplosion.Volume = 0.5
  1145. local newplane = planemodel:Clone()
  1146. newplane.Parent = game.Workspace
  1147. newplane:MakeJoints()
  1148.  
  1149. else
  1150. local m = Instance.new("Message", game.Workspace)
  1151. m.Text = "SERVER: The plane seems to have glitched out somehow, reseting game..."
  1152. game.Workspace:FindFirstChild("Plane"):remove()
  1153. wait(5)
  1154. m:remove()
  1155. local newplane = planemodel:Clone()
  1156. newplane.Parent = game.Workspace
  1157. newplane:MakeJoints()
  1158.  
  1159. hasglitched.Value = false -- reset the value to continue debugging
  1160. end
  1161. end
  1162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement