Scorpion2

Fire kings nooby death bobo fart spread of shrek nununununu

Nov 22nd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. create, gp, gp2, c3, v3, ins, bc, cf, c255, v2 = LoadLibrary("RbxUtility").Create, UDim.new, UDim2.new, Color3.new, Vector3.new, Instance.new, BrickColor, CFrame, function(r,g,b) return Color3.new(r/255, g/255, b/255) end, Vector2.new;
  2.  
  3.  
  4. function isInArray(array, wantedValue)
  5. for index, value in next, array do
  6. if value == wantedValue then
  7. return true
  8. end
  9. end
  10. return false
  11. end
  12.  
  13. ------------------------------------------------------------------------
  14. ------------------------------------------------------------------------
  15.  
  16. -- script.Parent = create "HopperBin" {Name = ""}
  17.  
  18.  
  19. local ignited = {}
  20. local timeOffset = 1
  21.  
  22.  
  23.  
  24. function makeHazardous(t)
  25. t.Touched:connect(function(p)
  26. local plr = game:GetService("Players"):GetPlayerFromCharacter(p.Parent)
  27.  
  28. if plr and plr.Character and plr.Character.Humanoid then
  29. local char = plr.Character
  30. local hum = char.Humanoid
  31.  
  32. while isInArray(t:GetTouchingParts(), p) do
  33. hum:TakeDamage(2)
  34. wait(0.1)
  35. end
  36. end
  37. end)
  38. end
  39.  
  40.  
  41. function ignite(p)
  42. if not ignited[p] and p:IsA("BasePart") and p.ClassName ~= "Terrain" then
  43. ignited[p] = #ignited or 0
  44.  
  45. delay(math.random(5, 15) * timeOffset, function()
  46. local fire = ins("Fire", p)
  47. fire.Name = ""
  48.  
  49. local function setFire()
  50. fire.Size = p.Size.X + p.Size.Y + p.Size.Z
  51. end
  52.  
  53. setFire()
  54. p.Changed:connect(setFire)
  55.  
  56. makeHazardous(p)
  57.  
  58. delay((p.Size.X/3 + p.Size.Y/3 + p.Size.Z/3) * timeOffset, function()
  59. ignited[p] = nil
  60. p:Destroy()
  61. end)
  62. end)
  63.  
  64. for _, part in next, p:GetTouchingParts() do
  65. ignite(part)
  66. end
  67.  
  68. return true
  69. end
  70. end
  71.  
  72.  
  73. function spread(trg)
  74. ignite(trg)
  75. for _, child in next, trg:GetChildren() do
  76. if not ignite(child) then
  77. spread(child)
  78. end
  79. end
  80. end
  81.  
  82.  
  83. ------------------------------------------------------------------------
  84. ------------------------------------------------------------------------
  85.  
  86. spread(workspace)
Add Comment
Please, Sign In to add comment