Advertisement
PlanetTheo

Gas can FE

Mar 10th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.35 KB | None | 0 0
  1. --converted to FE script by PlanetTheo--
  2.  
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  5. do
  6. print("Converted To FE Script By PlanetTheo.")
  7. script.Parent = Player.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent and t.Function then
  33. t.Function(...)
  34. end
  35. end
  36. m.TrigEvent = te
  37. UIS.TrigEvent = te
  38.  
  39. Event.OnServerEvent:Connect(function(plr,io)
  40. if plr~=Player then return end
  41. if io.isMouse then
  42. m.Target = io.Target
  43. m.Hit = io.Hit
  44. else
  45. local b = io.UserInputState == Enum.UserInputState.Begin
  46. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  47. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  48. end
  49. for _,t in pairs(CAS.Actions) do
  50. for _,k in pairs(t.Keys) do
  51. if k==io.KeyCode then
  52. t.Function(t.Name,io.UserInputState,io)
  53. end
  54. end
  55. end
  56. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  57. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  58. end
  59. end)
  60. Event.Parent = NLS([==[
  61. local Player = game:GetService("Players").LocalPlayer
  62. local Event = script:WaitForChild("UserInput_Event")
  63.  
  64. local UIS = game:GetService("UserInputService")
  65. local input = function(io,a)
  66. if a then return end
  67. --Since InputObject is a client-side instance, we create and pass table instead
  68. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  69. end
  70. UIS.InputBegan:Connect(input)
  71. UIS.InputEnded:Connect(input)
  72.  
  73. local h,t
  74. --Give the server mouse data 30 times every second, but only if the values changed
  75. --If player is not moving their mouse, client won't fire events
  76. while wait(1/30) do
  77. if h~=Mouse.Hit or t~=Mouse.Target then
  78. h,t=Mouse.Hit,Mouse.Target
  79. Event:FireServer({isMouse=true,Target=t,Hit=h})
  80. end
  81. end]==],Player.Character)
  82. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  83. end
  84. ---------------------------------------------------------------------------------
  85. -- By : jarredbcv
  86. -- Fire spread by : samfun123
  87.  
  88. lp = owner
  89. pl = lp.Character
  90. tol = Instance.new("HopperBin",lp.Backpack)
  91. tol.Name = "Gas"
  92. burn = {}
  93. burning = {}
  94. colr={"Neon orange","Black","White","Bright yellow","Bright red","Bright blue","Bright green","Really black","Royal purple","Magenta","Pink"}
  95. col="Neon orange"
  96. Part = function(x,y,z,color,tr,cc,an,parent)
  97. local p = Instance.new('Part',parent or Weapon)
  98. p.formFactor = 'Custom'
  99. p.Size = Vector3.new(x,y,z)
  100. p.BrickColor = BrickColor.new(color)
  101. p.CanCollide = cc
  102. p.Transparency = tr
  103. p.Anchored = an
  104. p.TopSurface,p.BottomSurface = 0,0
  105. return p
  106. end
  107.  
  108. fir = function(parent)
  109. local fi = Instance.new('Fire',parent or Weapon)
  110. fi.Name = "Fire"
  111. table.insert(burning,parent)
  112. game.Debris:AddItem(parent,2)
  113. if parent.Name ~= "Match" then
  114. fi.Color=parent.BrickColor.Color
  115. function touch(hit)
  116. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  117. if hit.Parent.Name==pl.Name then return end
  118. hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health - 10
  119. end
  120. end
  121. parent.Touched:connect(touch)
  122. end
  123. return fi
  124. end
  125.  
  126. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  127. p0.Position = p1.Position
  128. local w = Instance.new('Motor',par or p0)
  129. w.Part0 = p0
  130. w.Part1 = p1
  131. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  132. return w
  133. end
  134.  
  135. Mesh = function(par,num,x,y,z)
  136. local msh = _
  137. if num == 1 then
  138. msh = Instance.new("CylinderMesh",par)
  139. elseif num == 2 then
  140. msh = Instance.new("SpecialMesh",par)
  141. msh.MeshType = 3
  142. elseif num == 3 then
  143. msh = Instance.new("BlockMesh",par)
  144. elseif type(num) == 'string' then
  145. msh = Instance.new("SpecialMesh",par)
  146. msh.MeshId = num
  147. end
  148. msh.Scale = Vector3.new(x,y,z)
  149. return msh
  150. end
  151.  
  152. mo=Instance.new("Model",pl)
  153. function throw()
  154. hot=false
  155. for i = 1,10 do
  156. wait()
  157. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  158. end
  159. mtch = Part(.2,.1,.2,'Black',0,true,false,mo)
  160. mtch:BreakJoints()
  161. mtch.Name = "Match"
  162. mtch.CFrame=pl["Left Arm"].CFrame + Vector3.new(.5,0,0)
  163. fir(mtch)
  164. game.Debris:AddItem(mtch,1)
  165. function touch(hit)
  166. if hit.Name=="veryhotfire" and hit:FindFirstChild("Fire") == nil then
  167. fir(hit)
  168. end
  169. end
  170. mtch.Touched:connect(touch)
  171. fakel2.C0=crnt
  172. end
  173.  
  174. function pour()
  175. brek=false
  176. while wait() do
  177. if brek==true then break end
  178. liq = Part(2,.1,2,col,.9,false,true,workspace)
  179. m = Mesh(liq,1,1,1,1)
  180. liq.CFrame = CFrame.new(por.CFrame.x,por.CFrame.y,por.CFrame.z)-Vector3.new(0,.4,0)
  181. liq.Name = "veryhotfire"
  182. end
  183. end
  184.  
  185. function depour()
  186. brek=true
  187. end
  188. num=0
  189. function onKeyDown(key)
  190. key = key:lower()
  191. if key == "e" then
  192. throw()
  193. elseif key == "q" then
  194. for i = 1,10 do
  195. wait()
  196. fakel2.C0=fakel2.C0* CFrame.Angles(0, 0, math.rad(-i))
  197. end
  198. box = Part(1,2,1,'Bright red',0,true,false,workspace)
  199. box.Material="CorrodedMetal"
  200. box:BreakJoints()
  201. m=Mesh(box,1,1,1,1)
  202. box.Name = "Crate"
  203. box.CFrame=pl["Left Arm"].CFrame + Vector3.new(1,0,0)*CFrame.Angles(0,0,math.pi/2)
  204. fakel2.C0=crnt
  205. elseif key == "r" then
  206. num=num+1
  207. col=colr[num]
  208. por.BrickColor=BrickColor.new(col)
  209. Spawn(function()
  210. tol.Name=col
  211. wait(1)
  212. tol.Name="Gas"
  213. end)
  214. if num==11 then num=0 end
  215. end
  216. end
  217. function onClicked(mouse)
  218. for i=1,10 do
  219. wait()
  220. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-i/10,-math.pi/2,math.pi/2)
  221. end
  222. por.Transparency=0.4
  223. pour()
  224. end
  225. function deClicked(mouse)
  226. for i=1,10 do wait()
  227. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(-1+i/10,-math.pi/2,math.pi/2)
  228. por.Transparency=1
  229. depour()
  230. end
  231. end
  232.  
  233. mpa= Part(1.25,1.5,.6,'Really red',0,false,false,mo)
  234. mwl= Weld(mpa,pl.Torso,0,0,.8,0,0,0,mo)
  235. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  236. wl= Weld(pa,mpa,.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  237. pa= Part(.6,1.5,.6,'Really red',0,false,false,mo)
  238. wl= Weld(pa,mpa,-.61,0,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  239. pa= Part(.3,.3,.3,'Dark stone grey',0,false,false,mo)
  240. wl= Weld(pa,mpa,-.4,.75,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  241. pa= Part(.2,.3,.2,'',0,false,false,mo)
  242. wl= Weld(pa,mpa,-.4,1,0,0,0,0,mo)m=Mesh(pa,1,1,1,1)
  243. noz= Part(.2,.7,.2,'',0,false,false,mo)
  244. wl= Weld(noz,mpa,-.625,1.335,0,0,0,math.pi/4,mo)m=Mesh(noz,1,1,1,1)
  245. por = Part(.15,3,.15,col,1,false,false,mo)
  246. wl= Weld(por,noz,-1.3,1.15,0,0,0,math.pi/3,mo)m=Mesh(por,1,1,1,1)
  247.  
  248. tol.Selected:connect(function(mouse)
  249. mouse.Button1Down:connect(function() onClicked(mouse) end)
  250. mouse.Button1Up:connect(function() deClicked(mouse) end)
  251. mouse.KeyDown:connect(onKeyDown)
  252.  
  253. wlds=Instance.new("Model",pl)
  254. mwl.Part1 = pl["Right Arm"]
  255. mwl.C1 = CFrame.new(0,-1.5,0)*CFrame.Angles(0,-math.pi/2,math.pi/2)
  256. bas = Part(1,1,1,'',1,false,false,wlds)
  257. bas2 = Part(1,1,1,'',1,false,false,wlds)
  258. bas:BreakJoints()
  259. bas2:BreakJoints()
  260. fakel = Instance.new("Weld",wlds)
  261. fakel.Part0 = pl.Torso
  262. fakel.Part1 = bas
  263. fakel2 = Instance.new("Weld",wlds)
  264. fakel2.Part0 = pl.Torso
  265. fakel2.Part1 = bas2
  266. coroutine.wrap(function()
  267. for angle = 0, 45, 5 do
  268. fakel.C0 = CFrame.new(1.5, 0.5, .15) * CFrame.Angles(math.rad(angle*1.5), math.rad(angle/2), math.rad(-angle/3))
  269. wait()
  270. end
  271. end)()
  272. coroutine.wrap(function()
  273. for angle = 0, 45, 5 do
  274. fakel2.C0 = CFrame.new(-.75, 0.5, -0.3) * CFrame.Angles(math.rad(angle*2), math.rad(0), math.rad(angle*1.25))
  275. wait()
  276. end
  277. crnt=fakel2.C0
  278. end)()
  279. welditbro = Instance.new("Weld", wlds)
  280. welditbro.C0 = CFrame.new(0, 0.5, 0)
  281. welditbro.Part0 = pl['Right Arm']
  282. welditbro.Part1 = bas
  283. welditbro2 = Instance.new("Weld", wlds)
  284. welditbro2.C0 = CFrame.new(0, 0.5, -0.3)
  285. welditbro2.Part0 = pl['Left Arm']
  286. welditbro2.Part1 = bas2
  287. end)
  288.  
  289. tol.Deselected:connect(function(mouse)
  290. wlds:remove()
  291. mwl.Part1 = pl.Torso
  292. mwl.C1 = CFrame.new(0,0,.8)
  293. end)
  294.  
  295. for _,check in pairs(workspace:GetChildren()) do
  296. if check.Name == "veryhotfire" or check.Name == "Crate" then
  297. table.insert(burn,check)
  298. end
  299. end
  300.  
  301. workspace.ChildAdded:connect(function(check)
  302. wait(0)
  303. if check.Name == "veryhotfire" or check.Name == "Crate" then
  304. table.insert(burn,check)
  305. end
  306. end)
  307.  
  308. while true do
  309. wait()
  310. for _,b in pairs(burning) do
  311. if b.Parent ~= nil then
  312. spread = false
  313. for _,g in pairs(burn) do
  314. if g.Parent ~= nil and g:FindFirstChild("Fire") == nil then
  315. dist = (b.Position - g.Position).magnitude
  316. if dist <= 3 then
  317. spread = true
  318. fir(g)
  319. if g.Name == "Crate" then
  320. delay(0,function()
  321. wait(1)
  322. b = Instance.new("Explosion",workspace)
  323. b.Position = g.Position
  324. g:Destroy()
  325. end)
  326. end
  327. end
  328. else
  329. table.remove(burn,_)
  330. end
  331. end
  332. else
  333. table.remove(burning,_)
  334. end
  335. if spread == true then
  336. wait()
  337. end
  338. end
  339. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement