So I’m using the classic brick battle gears (with some tweaks) for my 2007 styled brick battle game but when a player explodes with a rocket launcher/timebomb it has a chance of making them invisible. I looked on some dev forums and the answer to make this stop seems to be making DestroyJointRadiusPercent set to 0, but this prevents the body parts of the player from being flung which is not ideal.
Does anyone know how I could fix this issue or just create a “artificial” explosion?
Code examples will be appreciated!
You could set the properties that have the instance “explosion” like the pressure to 0, I think it would stop doing that, if not, create an artificial explosion
I don’t really know enough to draw any conclusions, but my best guess is that the explosion is local and only kills players on the client.
If nothing else works, here’s a quick artificial explosion.
local blastRadius = 10
local blastPressure = 10000
--- Creates an explosion at a position
-- Makes an explosion effect and kills anything near it
-- @param position position to create explosion at
-- @return nil
local function explode(position: Vector3): nil
-- Create explosion effect
local explosion = Instance.new("Explosion")
explosion.Position = position
explosion.DestroyJointRadiusPercent = 0
explosion.BlastRadius = blastRadius
explosion.BlastPressure = blastPressure
explosion.Parent = workspace
-- Kill everything that got hit
local overlapParams = OverlapParams.new()
local hit = workspace:GetPartBoundsInRadius(position, blastRadius, overlapParams)
for _, instance in hit do
if instance.Parent
and instance.Parent:FindFirstChildWhichIsA("Humanoid")
and instance.Parent:FindFirstChild("HumanoidRootPart")
then
instance.Parent:FindFirstChildWhichIsA("Humanoid").Health = 0
end
end
return
end
Feel free to tweak as you wish.
No, the explosions are actually server sided which makes me even more confused.
Let me try that artificial explosion out.
so the code provided here will probably work, but the reason this issue is happening is most likely due to how roblox explosions work.
Explosions depending on their properties will snap joints, meaning someones limbs might come off, along with that they sometimes just get completely destroyed, or just disappear.
So yeah thats most likely the reasoning behind it, the solution would be to make an artificial explosion as @thefightboy_yt mentioned.
Which can be done by creating an explosion and setting both BlastPressure and BlastRadius to 0.
:]
I replied to the wrong person oops
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.