Advertisement
aarontje11002

NUKE!

Mar 24th, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. updateInterval = .4
  2.  
  3. currentColor = 1
  4. colors = {26, 21}
  5.  
  6. ticksound = Instance.new("Sound")
  7. ticksound.SoundId = "rbxasset://sounds\\clickfast.wav"
  8. ticksound.Parent = script.Parent
  9.  
  10. function update()
  11. updateInterval = updateInterval * .9
  12.  
  13. script.Parent.BrickColor = BrickColor.new(colors[currentColor])
  14. currentColor = currentColor + 1
  15. if (currentColor > 2) then currentColor = 1 end
  16. end
  17.  
  18.  
  19. function blowUp()
  20. local sound = Instance.new("Sound")
  21. sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
  22. sound.Parent = script.Parent
  23. sound.Volume = 1
  24. sound:play()
  25. explosion = Instance.new("Explosion")
  26. explosion.BlastRadius = 120000000000000000000000000000000000000000000000000000000000000000000000000000000000
  27. explosion.BlastPressure = 1000000000000000000000000000000000000000000000000000000000000000000000000000000000 -- these are really dangerous units
  28.  
  29. -- find instigator tag
  30. local creator = script.Parent:findFirstChild("creator")
  31. if creator ~= nil then
  32. explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
  33. end
  34.  
  35. explosion.Position = script.Parent.Position
  36. explosion.Parent = game.Workspace
  37. script.Parent.Transparency = 1
  38. end
  39.  
  40. function onPlayerBlownUp(part, distance, creator)
  41. if part.Name == "Head" then
  42. local humanoid = part.Parent.Humanoid
  43. tagHumanoid(humanoid, creator)
  44. end
  45. end
  46.  
  47. function tagHumanoid(humanoid, creator)
  48. -- tag does not need to expire iff all explosions lethal
  49.  
  50. if creator ~= nil then
  51. local new_tag = creator:clone()
  52. new_tag.Parent = humanoid
  53. end
  54. end
  55.  
  56. function untagHumanoid(humanoid)
  57. if humanoid ~= nil then
  58. local tag = humanoid:findFirstChild("creator")
  59. if tag ~= nil then
  60. tag.Parent = nil
  61. end
  62. end
  63. end
  64.  
  65. while updateInterval > .1 do
  66. wait(updateInterval)
  67. update()
  68.  
  69.  
  70. ticksound:play()
  71.  
  72. end
  73.  
  74. blowUp(1000)
  75. wait(1000)
  76. script.Parent:remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement