Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does a explosion not go into a clone that i made?

Asked by 2 years ago
Edited 2 years ago

I'm making a bomb gear, and when you click it drops a bomb which then explodes. But for some reason the explosion does not exist, which is very weird.

local tool = script.Parent

tool.Activated:Connect(function()
    local clone = tool.Handle:Clone()
    clone.Parent = workspace
    clone.Position = tool.Handle.Position
    clone.CanCollide = true
    wait(3)
    local ex = Instance.new('Explosion')
    ex.Parent = clone
    ex.Position = clone.Position
    ex.BlastRadius = 10
    ex.DestroyJointRadiusPercent = 100
    clone:Destroy()
end)

0
oh TestAccount_PinkLeaf 14 — 2y
0
What? SirSuperScorpion 27 — 2y
0
why did you say "oh" ? SirSuperScorpion 27 — 2y
0
Yeah lol. Their famous last words were, "oh". Voltaicmimic 43 — 2y

1 answer

Log in to vote
1
Answered by
Hypoxla 125
2 years ago

The problem is the part clone destroys before the explosion can even be made.

To fix this, just use wait().

wait(1)
clone:Destroy()

The part will still be visible while it explodes, so if you want it to explode but not be visible, use this:

    clone.Transparency = 1
    wait(3)
    clone:Destroy()
0
Tysm! SirSuperScorpion 27 — 2y
Ad

Answer this question