Ilkailka

Gas can

Apr 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1.  
  2.  
  3. lp = game.Players.LocalPlayer
  4. pl = lp.Character
  5. tol = Instance.new("HopperBin",lp.Backpack)
  6. tol.Name = "Gas"
  7. burn = {}
  8. burning = {}
  9. colr={"Neon orange","Black","White","Bright yellow","Bright red","Bright blue","Bright green","Really black","Royal purple","Magenta","Pink"}
  10. col="Neon orange"
  11. Part = function(x,y,z,color,tr,cc,an,parent)
  12. local p = Instance.new('Part',parent or Weapon)
  13. p.formFactor = 'Custom'
  14. p.Size = Vector3.new(x,y,z)
  15. p.BrickColor = BrickColor.new(color)
  16. p.CanCollide = cc
  17. p.Transparency = tr
  18. p.Anchored = an
  19. p.TopSurface,p.BottomSurface = 0,0
  20. return p
  21. end
  22.  
  23. fir = function(parent)
  24. local fi = Instance.new('Fire',parent or Weapon)
  25. fi.Name = "Fire"
  26. table.insert(burning,parent)
  27. game.Debris:AddItem(parent,2)
  28. if parent.Name ~= "Match" then
  29. fi.Color=parent.BrickColor.Color
  30. function touch(hit)
  31. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  32. if hit.Parent.Name==pl.Name then return end
  33. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health - 10
  34. end
  35. end
  36. parent.Touched:connect(touch)
  37. end
  38. return fi
  39. end
  40.  
  41. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  42. p0.Position = p1.Position
  43. local w = Instance.new('Motor',par or p0)
  44. w.Part0 = p0
  45. w.Part1 = p1
  46. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  47. return w
  48. end
  49.  
  50. Mesh = function(par,num,x,y,z)
  51. local msh = _
  52. if num == 1 then
  53. msh = Instance.new("CylinderMesh",par)
  54. elseif num == 2 then
  55. msh = Instance.new("SpecialMesh",par)
  56. msh.MeshType = 3
  57. elseif num == 3 then
  58. msh = Instance.new("BlockMesh",par)
  59. elseif type(num) == 'string' then
  60. msh = Instance.new("SpecialMesh",par)
  61. msh.MeshId = num
  62. end
  63. msh.Scale = Vector3.new(x,y,z)
  64. return msh
  65. end
  66.  
  67. mo=Instance.new("Model",pl)
  68. function throw()
  69. hot=false
  70. for i = 1,10 do
  71. wait()
  72. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  73. end
  74. mtch = Part(.2,.1,.2,'Black',0,true,false,mo)
  75. mtch:BreakJoints()
  76. mtch.Name = "Match"
  77. mtch.CFrame=pl["Left Arm"].CFrame + Vector3.new(.5,0,0)
  78. fir(mtch)
  79. game.Debris:AddItem(mtch,1)
  80. function touch(hit)
  81. if hit.Name=="veryhotfire" and hit:FindFirstChild("Fire") == nil then
  82. fir(hit)
  83. end
  84. end
  85. mtch.Touched:connect(touch)
  86. fakel2.C0=crnt
  87. end
  88.  
  89. function pour()
  90. brek=false
  91. while wait() do
  92. if brek==true then break end
  93. liq = Part(2,.1,2,col,.9,false,true,workspace)
  94. m = Mesh(liq,1,1,1,1)
  95. liq.CFrame = CFrame.new(por.CFrame.x,por.CFrame.y,por.CFrame.z)-Vector3.new(0,.4,0)
  96. liq.Name = "veryhotfire"
  97. end
  98. end
  99.  
  100. function depour()
  101. brek=true
  102. end
  103. num=0
  104. function onKeyDown(key)
  105. key = key:lower()
  106. if key == "e" then
  107. throw()
  108. elseif key == "q" then
  109. for i = 1,10 do
  110. wait()
  111. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  112. end
  113. box = Part(1,2,1,'Bright red',0,true,false,workspace)
  114. box.Material="CorrodedMetal"
  115. box:BreakJoints()
  116. m=Mesh(box,1,1,1,1)
  117. box.Name = "Crate"
  118. box.CFrame=pl["Left Arm"].CFrame + Vector3.new(1,0,0)*CFrame.Angles(0,0,math.pi/2)
  119. fakel2.C0=crnt
  120. elseif key == "r" then
  121. num=num+1
  122. col=colr[num]
  123. por.BrickColor=BrickColor.new(col)
  124. Spawn(function()
  125. tol.Name=col
  126. wait(1)
  127. tol.Name="Gas"
  128. end)
  129. if num==11 then num=0 end
  130. end
  131. end
  132. function onClicked(mouse)
  133. for i=1,10 do
  134. wait()
  135. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-i/10,-math.pi/2,math.pi/2)
  136. end
  137. por.Transparency=0.4
  138. pour()
  139. end
  140. function deClicked(mouse)
  141. for i=1,10 do wait()
  142. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-1+i/10,-math.pi/2,math.pi/2)
  143. por.Transparency=1
  144. depour()
  145. end
  146. end
  147.  
  148. mpa= Part(1.25,1.5,.6,'Really red',0,false,false,mo)
  149. mwl= Weld(mpa,pl.Torso,0,0,.8,0,0,0,mo)
  150. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  151. wl= Weld(pa,mpa,.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  152. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  153. wl= Weld(pa,mpa,-.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  154. pa= Part(.3,.3,.3,'Dark stone grey',0,false,false,mo)
  155. wl= Weld(pa,mpa,-.4,.75,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  156. pa= Part(.2,.3,.2,'',0,false,false,mo)
  157. wl= Weld(pa,mpa,-.4,1,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  158. noz= Part(.2,.7,.2,'',0,false,false,mo)
  159. wl= Weld(noz,mpa,-.625,1.335,0,0,0,math.pi/4,mo)m=Mesh(noz,1,1,1,1)
  160. por = Part(.15,3,.15,col,1,false,false,mo)
  161. wl= Weld(por,noz,-1.3,1.15,0,0,0,math.pi/3,mo)m=Mesh(por,1,1,1,1)
  162.  
  163. tol.Selected:connect(function(mouse)
  164. mouse.Button1Down:connect(function() onClicked(mouse) end)
  165. mouse.Button1Up:connect(function() deClicked(mouse) end)
  166. mouse.KeyDown:connect(onKeyDown)
  167.  
  168. wlds=Instance.new("Model",pl)
  169. mwl.Part1 = pl["Right Arm"]
  170. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(0,-math.pi/2,math.pi/2)
  171. bas = Part(1,1,1,'',1,false,false,wlds)
  172. bas2 = Part(1,1,1,'',1,false,false,wlds)
  173. bas:BreakJoints()
  174. bas2:BreakJoints()
  175. fakel = Instance.new("Weld",wlds)
  176. fakel.Part0 = pl.Torso
  177. fakel.Part1 = bas
  178. fakel2 = Instance.new("Weld",wlds)
  179. fakel2.Part0 = pl.Torso
  180. fakel2.Part1 = bas2
  181. coroutine.wrap(function()
  182. for angle = 0, 45, 5 do
  183. fakel.C0 = CFrame.new(1.5, 0.5, .15) * CFrame.Angles(math.rad(angle*1.5), math.rad(angle/2), math.rad(-angle/3))
  184. wait()
  185. end
  186. end)()
  187. coroutine.wrap(function()
  188. for angle = 0, 45, 5 do
  189. fakel2.C0 = CFrame.new(-.75, 0.5, -0.3) * CFrame.Angles(math.rad(angle*2), math.rad(0), math.rad(angle*1.25))
  190. wait()
  191. end
  192. crnt=fakel2.C0
  193. end)()
  194. welditbro = Instance.new("Weld", wlds)
  195. welditbro.C0 = CFrame.new(0, 0.5, 0)
  196. welditbro.Part0 = pl['Right Arm']
  197. welditbro.Part1 = bas
  198. welditbro2 = Instance.new("Weld", wlds)
  199. welditbro2.C0 = CFrame.new(0, 0.5, -0.3)
  200. welditbro2.Part0 = pl['Left Arm']
  201. welditbro2.Part1 = bas2
  202. end)
  203.  
  204. tol.Deselected:connect(function(mouse)
  205. wlds:remove()
  206. mwl.Part1 = pl.Torso
  207. mwl.C1 = CFrame.new(0,0,.8)
  208. end)
  209.  
  210. for _,check in pairs(workspace:GetChildren()) do
  211. if check.Name == "veryhotfire" or check.Name == "Crate" then
  212. table.insert(burn,check)
  213. end
  214. end
  215.  
  216. workspace.ChildAdded:connect(function(check)
  217. wait(0)
  218. if check.Name == "veryhotfire" or check.Name == "Crate" then
  219. table.insert(burn,check)
  220. end
  221. end)
  222.  
  223. while true do
  224. wait()
  225. for _,b in pairs(burning) do
  226. if b.Parent ~= nil then
  227. spread = false
  228. for _,g in pairs(burn) do
  229. if g.Parent ~= nil and g:FindFirstChild("Fire") == nil then
  230. dist = (b.Position - g.Position).magnitude
  231. if dist <= 3 then
  232. spread = true
  233. fir(g)
  234. if g.Name == "Crate" then
  235. delay(0,function()
  236. wait(1)
  237. b = Instance.new("Explosion",workspace)
  238. b.Position = g.Position
  239. g:Destroy()
  240. end)
  241. end
  242. end
  243. else
  244. table.remove(burn,_)
  245. end
  246. end
  247. else
  248. table.remove(burning,_)
  249. end
  250. if spread == true then
  251. wait()
  252. end
  253. end
  254. end
Add Comment
Please, Sign In to add comment