Is there anyway I can simplify this script, because I have a lot of "dark"s e.g I have dark, dark1, dark2 etc, is there any way I can do all of them in bulk instead of individually?

z = Enemies.Dark

backup = z:clone()

while true do
	wait(3)
end
	if char.Humanoid.Health == 0 then
	if z.Zombie.Health == 0 then
		z:Remove()
		
		backup.Parent = game.Workspace
		backup.Head:MakeJoints()
		backup.Torso:MakeJoints()
	end
	if z == nil then
		
		backup.Parent = game.Workspace
		backup.Head:MakeJoints()
		backup.Torso:MakeJoints()

2 comments

0

You may want to look into Spawn or coroutines. Just be careful though as creating multiple threads requires you to be more aware of what state your variables can be in at a given time. Also, that while true do statement is nonterminating.

0

what does that mean about the while true