I am trying to make a reset button then if i've spawned like 15 zombie then if i click on the reset button them all just destroys but cant get it to work it just destroys one of them every time i click on the reset button heres the code
local Player = game.Players.LocalPlayer
Cash = Player.leaderstats.Cash
Units = Player.leaderstats.Units
function onClick()
if game.Workspace.Barbarian then
game.Workspace.Barbarian:Destroy()
end
Cash.Value = 100
Units.Value = 0
end
script.Parent.MouseButton1Click:connect(onClick)
