Whatever the paintball hits, it creates an explosion that does 25-1000 damage depending on if it's a direct hit or splash damage. Anyone help? By the way, blast pressure is 0, and blast radius I will determine.
ball = script.Parent
damage = 25
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Zombie")
if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid.Health = humanoid.Health - damage
wait(2)
untagHumanoid(humanoid)
end
connection:disconnect()
ball.Parent = nil
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)
wait(0.8)
ball.Parent = nil
