Im trying to find a way to restrict an explosion like from a bomb or a rocket launcher to stop being able to kill the person who launched the rocket or triggered the bomb. If anyone could please help I would greatly appreciate it, I'm guessing it would have to be something with getting the parent humanoid of the bomb and making it unaffected by it.
How would I restrict an explosion from exploding/killing its Owner?
1 answer
ill just quote this first part directly from wiki:
"If a developer doesn’t want joints between BaseParts to be broken or wants to implement their own formula for damaging Humanoids it is recommended they set Explosion.DestroyJointRadiusPercent to 0 and use the Explosion.Hit event to handle the result of the explosion."
a humanoid only dies from an explosion cus the explosion breaks the neck joint of the humanoid. If u make an explosion not destroy any joints, u can effectively prevent any humanoids from dying to ur explosion. However, same goes for the enemies. To prevent this, u have to use explosion.Hit to filter ur humanoid but damage the enemies:
-- assuming u have already defined the (Explosion) and your (own player's humanoid) --
(Explosion).DestroyJointRadiusPercent = 0
(Explosion).Hit:Connect(function(part, distance)
local hum = part.Parent:FindFirstChild("Humanoid")
if hum and hum ~= (own player's Humanoid) then
hum:TakeDamage(100)
end
end)
or idk maybe there is a better way like an ignoreList
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
an explosion wont kill its parents cus it has no parents