Advertisement
astronaut32

gascan

Jan 23rd, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.04 KB | None | 0 0
  1.  
  2.  
  3. -- Gas
  4.  
  5.  
  6. -- By : jarredbcv
  7.  
  8.  
  9. -- Fire spread by : samfun123
  10.  
  11.  
  12.  
  13.  
  14.  
  15. lp = game.Players.LocalPlayer
  16.  
  17.  
  18. pl = lp.Character
  19.  
  20.  
  21. tol = Instance.new("HopperBin",lp.Backpack)
  22.  
  23.  
  24. tol.Name = "Gas"
  25.  
  26.  
  27. burn = {}
  28.  
  29.  
  30. burning = {}
  31.  
  32.  
  33. colr={"Neon orange","Black","White","Bright yellow","Bright red","Bright blue","Bright green","Really black","Royal purple","Magenta","Pink"}
  34.  
  35.  
  36. col="Neon orange"
  37.  
  38.  
  39. Part = function(x,y,z,color,tr,cc,an,parent)
  40.  
  41.  
  42. local p = Instance.new('Part',parent or Weapon)
  43.  
  44.  
  45. p.formFactor = 'Custom'
  46.  
  47.  
  48. p.Size = Vector3.new(x,y,z)
  49.  
  50.  
  51. p.BrickColor = BrickColor.new(color)
  52.  
  53.  
  54. p.CanCollide = cc
  55.  
  56.  
  57. p.Transparency = tr
  58.  
  59.  
  60. p.Anchored = an
  61.  
  62.  
  63. p.TopSurface,p.BottomSurface = 0,0
  64.  
  65.  
  66. return p
  67.  
  68.  
  69. end
  70.  
  71.  
  72.  
  73.  
  74.  
  75. fir = function(parent)
  76.  
  77.  
  78. local fi = Instance.new('Fire',parent or Weapon)
  79.  
  80.  
  81. fi.Name = "Fire"
  82.  
  83.  
  84. table.insert(burning,parent)
  85.  
  86.  
  87. game.Debris:AddItem(parent,2)
  88.  
  89.  
  90. if parent.Name ~= "Match" then
  91.  
  92.  
  93. fi.Color=parent.BrickColor.Color
  94.  
  95.  
  96. function touch(hit)
  97.  
  98.  
  99. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  100.  
  101.  
  102. if hit.Parent.Name==pl.Name then return end
  103.  
  104.  
  105. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health - 10
  106.  
  107.  
  108. end
  109.  
  110.  
  111. end
  112.  
  113.  
  114. parent.Touched:connect(touch)
  115.  
  116.  
  117. end
  118.  
  119.  
  120. return fi
  121.  
  122.  
  123. end
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  130.  
  131.  
  132. p0.Position = p1.Position
  133.  
  134.  
  135. local w = Instance.new('Motor',par or p0)
  136.  
  137.  
  138. w.Part0 = p0
  139.  
  140.  
  141. w.Part1 = p1
  142.  
  143.  
  144. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  145.  
  146.  
  147. return w
  148.  
  149.  
  150. end
  151.  
  152.  
  153.  
  154.  
  155.  
  156. Mesh = function(par,num,x,y,z)
  157.  
  158.  
  159. local msh = _
  160.  
  161.  
  162. if num == 1 then
  163.  
  164.  
  165. msh = Instance.new("CylinderMesh",par)
  166.  
  167.  
  168. elseif num == 2 then
  169.  
  170.  
  171. msh = Instance.new("SpecialMesh",par)
  172.  
  173.  
  174. msh.MeshType = 3
  175.  
  176.  
  177. elseif num == 3 then
  178.  
  179.  
  180. msh = Instance.new("BlockMesh",par)
  181.  
  182.  
  183. elseif type(num) == 'string' then
  184.  
  185.  
  186. msh = Instance.new("SpecialMesh",par)
  187.  
  188.  
  189. msh.MeshId = num
  190.  
  191.  
  192. end
  193.  
  194.  
  195. msh.Scale = Vector3.new(x,y,z)
  196.  
  197.  
  198. return msh
  199.  
  200.  
  201. end
  202.  
  203.  
  204.  
  205.  
  206.  
  207. mo=Instance.new("Model",pl)
  208.  
  209.  
  210. function throw()
  211.  
  212.  
  213. hot=false
  214.  
  215.  
  216. for i = 1,10 do
  217.  
  218.  
  219. wait()
  220.  
  221.  
  222. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  223.  
  224.  
  225. end
  226.  
  227.  
  228. mtch = Part(.2,.1,.2,'Black',0,true,false,mo)
  229.  
  230.  
  231. mtch:BreakJoints()
  232.  
  233.  
  234. mtch.Name = "Match"
  235.  
  236.  
  237. mtch.CFrame=pl["Left Arm"].CFrame + Vector3.new(.5,0,0)
  238.  
  239.  
  240. fir(mtch)
  241.  
  242.  
  243. game.Debris:AddItem(mtch,1)
  244.  
  245.  
  246. function touch(hit)
  247.  
  248.  
  249. if hit.Name=="veryhotfire" and hit:FindFirstChild("Fire") == nil then
  250.  
  251.  
  252. fir(hit)
  253.  
  254.  
  255. end
  256.  
  257.  
  258. end
  259.  
  260.  
  261. mtch.Touched:connect(touch)
  262.  
  263.  
  264. fakel2.C0=crnt
  265.  
  266.  
  267. end
  268.  
  269.  
  270.  
  271.  
  272.  
  273. function pour()
  274.  
  275.  
  276. brek=false
  277.  
  278.  
  279. while wait() do
  280.  
  281.  
  282. if brek==true then break end
  283.  
  284.  
  285. liq = Part(2,.1,2,col,.9,false,true,workspace)
  286.  
  287.  
  288. m = Mesh(liq,1,1,1,1)
  289.  
  290.  
  291. liq.CFrame = CFrame.new(por.CFrame.x,por.CFrame.y,por.CFrame.z)-Vector3.new(0,.4,0)
  292.  
  293.  
  294. liq.Name = "veryhotfire"
  295.  
  296.  
  297. end
  298.  
  299.  
  300. end
  301.  
  302.  
  303.  
  304.  
  305.  
  306. function depour()
  307.  
  308.  
  309. brek=true
  310.  
  311.  
  312. end
  313.  
  314.  
  315. num=0
  316.  
  317.  
  318. function onKeyDown(key)
  319.  
  320.  
  321. key = key:lower()
  322.  
  323.  
  324. if key == "e" then
  325.  
  326.  
  327. throw()
  328.  
  329.  
  330. elseif key == "q" then
  331.  
  332.  
  333. for i = 1,10 do
  334.  
  335.  
  336. wait()
  337.  
  338.  
  339. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  340.  
  341.  
  342. end
  343.  
  344.  
  345. box = Part(1,2,1,'Bright red',0,true,false,workspace)
  346.  
  347.  
  348. box.Material="CorrodedMetal"
  349.  
  350.  
  351. box:BreakJoints()
  352.  
  353.  
  354. m=Mesh(box,1,1,1,1)
  355.  
  356.  
  357. box.Name = "Crate"
  358.  
  359.  
  360. box.CFrame=pl["Left Arm"].CFrame + Vector3.new(1,0,0)*CFrame.Angles(0,0,math.pi/2)
  361.  
  362.  
  363. fakel2.C0=crnt
  364.  
  365.  
  366. elseif key == "r" then
  367.  
  368.  
  369. num=num+1
  370.  
  371.  
  372. col=colr[num]
  373.  
  374.  
  375. por.BrickColor=BrickColor.new(col)
  376.  
  377.  
  378. Spawn(function()
  379.  
  380.  
  381. tol.Name=col
  382.  
  383.  
  384. wait(1)
  385.  
  386.  
  387. tol.Name="Gas"
  388.  
  389.  
  390. end)
  391.  
  392.  
  393. if num==11 then num=0 end
  394.  
  395.  
  396. end
  397.  
  398.  
  399. end
  400.  
  401.  
  402. function onClicked(mouse)
  403.  
  404.  
  405. for i=1,10 do
  406.  
  407.  
  408. wait()
  409.  
  410.  
  411. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-i/10,-math.pi/2,math.pi/2)
  412.  
  413.  
  414. end
  415.  
  416.  
  417. por.Transparency=0.4
  418.  
  419.  
  420. pour()
  421.  
  422.  
  423. end
  424.  
  425.  
  426. function deClicked(mouse)
  427.  
  428.  
  429. for i=1,10 do wait()
  430.  
  431.  
  432. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-1+i/10,-math.pi/2,math.pi/2)
  433.  
  434.  
  435. por.Transparency=1
  436.  
  437.  
  438. depour()
  439.  
  440.  
  441. end
  442.  
  443.  
  444. end
  445.  
  446.  
  447.  
  448.  
  449.  
  450. mpa= Part(1.25,1.5,.6,'Really red',0,false,false,mo)
  451.  
  452.  
  453. mwl= Weld(mpa,pl.Torso,0,0,.8,0,0,0,mo)
  454.  
  455.  
  456. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  457.  
  458.  
  459. wl= Weld(pa,mpa,.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  460.  
  461.  
  462. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  463.  
  464.  
  465. wl= Weld(pa,mpa,-.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  466.  
  467.  
  468. pa= Part(.3,.3,.3,'Dark stone grey',0,false,false,mo)
  469.  
  470.  
  471. wl= Weld(pa,mpa,-.4,.75,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  472.  
  473.  
  474. pa= Part(.2,.3,.2,'',0,false,false,mo)
  475.  
  476.  
  477. wl= Weld(pa,mpa,-.4,1,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  478.  
  479.  
  480. noz= Part(.2,.7,.2,'',0,false,false,mo)
  481.  
  482.  
  483. wl= Weld(noz,mpa,-.625,1.335,0,0,0,math.pi/4,mo)m=Mesh(noz,1,1,1,1)
  484.  
  485.  
  486. por = Part(.15,3,.15,col,1,false,false,mo)
  487.  
  488.  
  489. wl= Weld(por,noz,-1.3,1.15,0,0,0,math.pi/3,mo)m=Mesh(por,1,1,1,1)
  490.  
  491.  
  492.  
  493.  
  494.  
  495. tol.Selected:connect(function(mouse)
  496.  
  497.  
  498. mouse.Button1Down:connect(function() onClicked(mouse) end)
  499.  
  500.  
  501. mouse.Button1Up:connect(function() deClicked(mouse) end)
  502.  
  503.  
  504. mouse.KeyDown:connect(onKeyDown)
  505.  
  506.  
  507.  
  508.  
  509.  
  510. wlds=Instance.new("Model",pl)
  511.  
  512.  
  513. mwl.Part1 = pl["Right Arm"]
  514.  
  515.  
  516. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(0,-math.pi/2,math.pi/2)
  517.  
  518.  
  519. bas = Part(1,1,1,'',1,false,false,wlds)
  520.  
  521.  
  522. bas2 = Part(1,1,1,'',1,false,false,wlds)
  523.  
  524.  
  525. bas:BreakJoints()
  526.  
  527.  
  528. bas2:BreakJoints()
  529.  
  530.  
  531. fakel = Instance.new("Weld",wlds)
  532.  
  533.  
  534. fakel.Part0 = pl.Torso
  535.  
  536.  
  537. fakel.Part1 = bas
  538.  
  539.  
  540. fakel2 = Instance.new("Weld",wlds)
  541.  
  542.  
  543. fakel2.Part0 = pl.Torso
  544.  
  545.  
  546. fakel2.Part1 = bas2
  547.  
  548.  
  549. coroutine.wrap(function()
  550.  
  551.  
  552. for angle = 0, 45, 5 do
  553.  
  554.  
  555. fakel.C0 = CFrame.new(1.5, 0.5, .15) * CFrame.Angles(math.rad(angle*1.5), math.rad(angle/2), math.rad(-angle/3))
  556.  
  557.  
  558. wait()
  559.  
  560.  
  561. end
  562.  
  563.  
  564. end)()
  565.  
  566.  
  567. coroutine.wrap(function()
  568.  
  569.  
  570. for angle = 0, 45, 5 do
  571.  
  572.  
  573. fakel2.C0 = CFrame.new(-.75, 0.5, -0.3) * CFrame.Angles(math.rad(angle*2), math.rad(0), math.rad(angle*1.25))
  574.  
  575.  
  576. wait()
  577.  
  578.  
  579. end
  580.  
  581.  
  582. crnt=fakel2.C0
  583.  
  584.  
  585. end)()
  586.  
  587.  
  588. welditbro = Instance.new("Weld", wlds)
  589.  
  590.  
  591. welditbro.C0 = CFrame.new(0, 0.5, 0)
  592.  
  593.  
  594. welditbro.Part0 = pl['Right Arm']
  595.  
  596.  
  597. welditbro.Part1 = bas
  598.  
  599.  
  600. welditbro2 = Instance.new("Weld", wlds)
  601.  
  602.  
  603. welditbro2.C0 = CFrame.new(0, 0.5, -0.3)
  604.  
  605.  
  606. welditbro2.Part0 = pl['Left Arm']
  607.  
  608.  
  609. welditbro2.Part1 = bas2
  610.  
  611.  
  612. end)
  613.  
  614.  
  615.  
  616.  
  617.  
  618. tol.Deselected:connect(function(mouse)
  619.  
  620.  
  621. wlds:remove()
  622.  
  623.  
  624. mwl.Part1 = pl.Torso
  625.  
  626.  
  627. mwl.C1 = CFrame.new(0,0,.8)
  628.  
  629.  
  630. end)
  631.  
  632.  
  633.  
  634.  
  635.  
  636. for _,check in pairs(workspace:GetChildren()) do
  637.  
  638.  
  639. if check.Name == "veryhotfire" or check.Name == "Crate" then
  640.  
  641.  
  642. table.insert(burn,check)
  643.  
  644.  
  645. end
  646.  
  647.  
  648. end
  649.  
  650.  
  651.  
  652.  
  653.  
  654. workspace.ChildAdded:connect(function(check)
  655.  
  656.  
  657. wait(0)
  658.  
  659.  
  660. if check.Name == "veryhotfire" or check.Name == "Crate" then
  661.  
  662.  
  663. table.insert(burn,check)
  664.  
  665.  
  666. end
  667.  
  668.  
  669. end)
  670.  
  671.  
  672.  
  673.  
  674.  
  675. while true do
  676.  
  677.  
  678. wait()
  679.  
  680.  
  681. for _,b in pairs(burning) do
  682.  
  683.  
  684. if b.Parent ~= nil then
  685.  
  686.  
  687. spread = false
  688.  
  689.  
  690. for _,g in pairs(burn) do
  691.  
  692.  
  693. if g.Parent ~= nil and g:FindFirstChild("Fire") == nil then
  694.  
  695.  
  696. dist = (b.Position - g.Position).magnitude
  697.  
  698.  
  699. if dist <= 3 then
  700.  
  701.  
  702. spread = true
  703.  
  704.  
  705. fir(g)
  706.  
  707.  
  708. if g.Name == "Crate" then
  709.  
  710.  
  711. delay(0,function()
  712.  
  713.  
  714. wait(1)
  715.  
  716.  
  717. b = Instance.new("Explosion",workspace)
  718.  
  719.  
  720. b.Position = g.Position
  721.  
  722.  
  723. g:Destroy()
  724.  
  725.  
  726. end)
  727.  
  728.  
  729. end
  730.  
  731.  
  732. end
  733.  
  734.  
  735. else
  736.  
  737.  
  738. table.remove(burn,_)
  739.  
  740.  
  741. end
  742.  
  743.  
  744. end
  745.  
  746.  
  747. else
  748.  
  749.  
  750. table.remove(burning,_)
  751.  
  752.  
  753. end
  754.  
  755.  
  756. if spread == true then
  757.  
  758.  
  759. wait()
  760.  
  761.  
  762. end
  763.  
  764.  
  765. end
  766.  
  767.  
  768. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement