I am trying to make a spawner that spawns zombies, but the spawner fills up the workspace with too many zombies at a time and the game gets laggy. I want the zombies to despawn once they have not been attacked for more than a minute.
Here is the code below. (The problem with this is that this despawns the zombie after 60 seconds, regardless if he has been attacked or not.)
local zombie = script.Parent.Parent
wait(60)
zombie:Destroy()
