A way to stop explosions from breaking Joins and welds, but take damage instead

Howdy, everyone!

image

I was looking to make a grenade launcher that shoots explosive bullets, but it does, however, come with an issue that I’m pretty sure that it’s common around those who use “Explosion” a lot.

image

Explosion can kill players by breaking the player joints and welds, it can also break welds from other parts.

and if it wasn’t clear enough, I don’t want that, I was thinking of changing something in the CoreScript of the explosion where it doesn’t break joints but instead do a Humanoid:TakeDamage() ​instead.

If that’s possible or you have a better solution then please let us know, so more people can find this post useful in the future.

Thank You.

2 Likes

You can use a property of a Humanoid object:

If you call an explosion from script, just set this property to false when explosion happens, and after - to true if you manually need Humanoid to break joints.

Hope this helps!

1 Like

If my solution doesn’t help, here’s another one:

The solution was:

local explosion = Instance.new("Explosion")
explosion.DestroyJointRadiusPercent = 0
explosion.Position = part.Position
explosion.Parent = workspace

Hope this is the real solution!

3 Likes

This does help, same with the first post that you made as well, but does the player take damage from the explosion though?

From the second solution provided, Humanoid will take damage from an explosion, but that explosion won’t break it’s joints and welds. Yeah, this should work.

1 Like

well, apparently it doesn’t…
I mean yes, it does not break joins, which is one step to the solution but now it comes the hard part by making the explosion damage the player by 10 for example.

Okay, so you can check the magnitude between part with explosion and player. And if it’s like 5 studs, take damage from Humanoid.

1 Like

image

Set up the Hit event to the explosion, check if the parent of the basepart belongs to a Humanoid via hit.Parent:FindFirstChild("Humanoid"), and check if they haven’t already been damaged (via a table), and if those criterias are true, damage them and put them in the table

If required, I can make an example

5 Likes

Thanks for that, that’s new information to me, and I’ll definitely find a use to it.
and thx to @sssssrg for helping as well, I appreciate it.

1 Like

No problem, good luck scripting! :wink:

1 Like

could you make an example please?