Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ball = script.Parent
- damage = 50
- function onTouched(hit)
- local humanoid = hit.Parent:findFirstChild("Humanoid")
- if humanoid~=nil then
- tagHumanoid(humanoid)
- humanoid.Health = humanoid.Health - damage
- wait(2)
- untagHumanoid(humanoid)
- connection:disconnect()
- else
- damage = damage / 2
- if damage < 2 then
- connection:disconnect()
- ball.Parent = nil
- end
- end
- if math.random(1,3) == 2 then
- explosion = Instance.new("Explosion")
- explosion.BlastRadius = 9
- explosion.BlastPressure = 1000000 -- these are really wussy units
- explosion.Position = script.Parent.Position
- explosion.Parent = game.Workspace
- connection:disconnect()
- ball.Parent = nil
- end
- end
- function tagHumanoid(humanoid)
- -- todo: make tag expire
- local tag = ball:findFirstChild("Gystac")
- 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("Gystac")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = ball.Touched:connect(onTouched)
- r = game:service("RunService")
- t, s = r.Stepped:wait()
- d = t + 5.0 - s
- while t < d do
- t = r.Stepped:wait()
- end
- ball.Parent = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement