Advertisement
kanewutt

ererererer

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