Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --wait()
- local ball = script.Parent
- local damage = 500
- function onTouched(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if hit:getMass() < 1.2 * 7 then
- if hit.Anchored == false then
- hit:BreakJoints()
- end
- end
- if humanoid ~= nil then
- tagHumanoid(humanoid)
- humanoid:TakeDamage(damage)
- wait(2)
- untagHumanoid(humanoid)
- end
- connection:disconnect()
- ball:remove()
- end
- function tagHumanoid(humanoid)
- -- todo: make tag expire
- local tag = ball:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = ball.Touched:connect(onTouched)
Add Comment
Please, Sign In to add comment