Alright, so I'm making a pinewood type of game and I tried doing this code:
game.Workspace.TenToZero.Value.Changed:connect(function() if game.Workspace.TenToZero.Value.Value == true then while true do game.Workspace.Part.Anchored = false expa.Position = game.Workspace.Part expa.Parent = script.Parent.Position expa.BlastPressure = 9999999 wait(0.4) end end end)
I'm trying to make this explode one part and then go to another, but it doesn't work properly. Is there a way to fix this?
Use a for
loop with pairs
.
for i, v in pairs(Workspace:GetChildren()) do if v:IsA("BasePart") then local e = Instance.new("Explosion") e.Position = v.Position e.BlastRadius = 10 e.BlastPressure = 1e6 e.Parent = Workspace end end