How to make Explosions Not Remove Welds

I want to make it so that the explosions do not remove welds

Whenever something explodes the welds are getting destroy and I cant figure out how to fix it

I have looked everwhere unable to find a answer
If someone knows any fixes I would love for you to tell me them

Set the Explosion.DestroyJointRadiusPercent property to 0

Alright Ill try that then ill tell you if it fixed it

It kind of worked but the NPCs are still alive

Use Explosion.Hit to make NPCS take damage.

Use the code given on the documentation:

local function customExplosion(position, radius, maxDamage)
	local explosion = Instance.new("Explosion")
	explosion.BlastPressure = 0 -- this could be set higher to still apply velocity to parts
	explosion.DestroyJointRadiusPercent = 0 -- joints are safe
	explosion.BlastRadius = radius
	explosion.Position = position

	-- set up a table to track the models hit
	local modelsHit = {}

	-- listen for contact
	explosion.Hit:Connect(function(part, distance)
		local parentModel = part.Parent
		if parentModel then
			-- check to see if this model has already been hit
			if modelsHit[parentModel] then
				return
			end
			-- log this model as hit
			modelsHit[parentModel] = true

			-- look for a humanoid
			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
			end
		end
	end)

	explosion.Parent = game.Workspace
end

customExplosion(Vector3.new(0, 10, 0), 12, 50)
1 Like