My issue is that whenever I make a part explode, the parts around it don’t go flying. And if they do, they only go flying for a second, but then I put them in Debris and they just stop mid air. I don’t really know how to fix this. Here is my code:
local DebrisService = game:GetService("Debris")
local module = {}
module.Explode = function(radius, bomb, player, waitTime)
print(radius,player,player.Character,bomb,waitTime)
local character = player.Character or player.CharacterAdded:Wait()
local backpack = player.Backpack
local playerBomb1 = character:FindFirstChild("IsBomb",true)
if bomb and playerBomb1 then
local playerBomb = playerBomb1.Parent
local newBomb = game.ReplicatedStorage.Bombs:FindFirstChild(bomb):Clone()
newBomb.Parent = game.Workspace
newBomb.PrimaryPart.Position = playerBomb.PrimaryPart.Position
task.wait(waitTime)
local newExplosion = Instance.new("Explosion")
newExplosion.BlastRadius = radius
newExplosion.BlastPressure = 200000
newExplosion.Parent = newBomb
newExplosion.Position = newBomb.PrimaryPart.Position
DebrisService:AddItem(newBomb,2)
newExplosion.Hit:Connect(function(part,distance)
if distance <= radius then
if part:GetAttribute("Breakable") then
DebrisService:AddItem(part,5)
end
end
end)
end
end
return module