KeroroGunso0

test

Mar 2nd, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. --wait()
  2. local ball = script.Parent
  3. local damage = 500
  4.  
  5. function onTouched(hit)
  6. local humanoid = hit.Parent:findFirstChild("Humanoid")
  7.  
  8.  
  9. if hit:getMass() < 1.2 * 7 then
  10. if hit.Anchored == false then
  11. hit:BreakJoints()
  12. end
  13. end
  14.  
  15.  
  16. if humanoid ~= nil then
  17. tagHumanoid(humanoid)
  18. humanoid:TakeDamage(damage)
  19. wait(2)
  20. untagHumanoid(humanoid)
  21. end
  22.  
  23. connection:disconnect()
  24. ball:remove()
  25. end
  26.  
  27. function tagHumanoid(humanoid)
  28. -- todo: make tag expire
  29. local tag = ball:findFirstChild("creator")
  30. if tag ~= nil then
  31. local new_tag = tag:clone()
  32. new_tag.Parent = humanoid
  33. end
  34. end
  35.  
  36.  
  37. function untagHumanoid(humanoid)
  38. if humanoid ~= nil then
  39. local tag = humanoid:findFirstChild("creator")
  40. if tag ~= nil then
  41. tag.Parent = nil
  42. end
  43. end
  44. end
  45.  
  46. connection = ball.Touched:connect(onTouched)
Add Comment
Please, Sign In to add comment