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

Anyway to simplify this enemy respawn?

Asked by
zomspi 541 Moderation Voter
4 years ago

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()
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. SteelMettle1 394 — 4y
0
what does that mean about the while true zomspi 541 — 4y

Answer this question