I’m trying to make my guided missile damage players only. I have already researched on other posts but couldn’t find the one that is right.
I tried using this:
Explosion.DestroyJointRadiusPercent = 0
But the player doesn’t take damage sadly
I’m trying to make my guided missile damage players only. I have already researched on other posts but couldn’t find the one that is right.
I tried using this:
Explosion.DestroyJointRadiusPercent = 0
But the player doesn’t take damage sadly
At the very bottom is the hit event I think you are looking for that.
Look up BlastPressure, BlastRadius and DestroyJointRadius at the link in @Dlbsp1983’s post.
Hit only returns the items hit by the explosion.
Uh I still don’t understand how to make it damages player only
Look at the code sample for BlastPressure. It does exactly what you want. It damages Humanoid Health, but doesn’t break welds in Parts, and can be set so the Explosion will push Unanchored Models, but not break them.
Do I use this one?
local humanoid = parentModel:FindFirstChild("Humanoid")
if humanoid then
local distanceFactor = distance / explosion.BlastRadius -- get the distance as a value between 0 and 1
distanceFactor = 1 - distanceFactor -- flip the amount, so that lower == closer == more damage
humanoid:TakeDamage(maxDamage * distanceFactor) -- TakeDamage to respect ForceFields
Found one and used this
Explosion.Hit:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent:FindFirstChild("Humanoid").Health = 0
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.