Solved Multiple fighters

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Aug 8, 2021
42
0
6
21
So I'm making a script where when the player inputs /applearmy and if the player's name is "Applespog" and the cooldown is ready, then spawns 5 zombies with apples on their heads.

Code:
command /applearmy:
    trigger:
        if the player's name is "Applespog":
            if {appleexplosioncld.%player%} is 0:
                loop all baby zombies in radius 50 of the player:
                    if the helmet of loop-entity is an apple:
                        kill loop-entity
                loop 5 times:
                    spawn a baby zombie
                    set helmet of last spawned entity to apple
                    add the last spawned entity to {mob::*}
                    set tool of last spawned entity to iron sword of sharpness 1
                    apply speed 3 to the last spawned entity for 30 seconds
                loop all entities in radius 10 around player:
                    if loop-entity is not the player:
                        if loop-entity's helmet is not an apple:
                            set target of {mob::*} to loop-entity
                set {appleexplosioncld.%player%} to 30
                while {appleexplosioncld.%player%} > 0:
                    wait 1 second
                    remove 1 from {appleexplosioncld.%player%}
            else:
                send action bar "&c%{appleexplosioncld.%player%}% Seconds remaining " to player


Sadly after killing one mob they just kill me instead of hunting for others, Can you please fix this? Thanks.