Solved Looping all fox named "Forest Fox" and displaying how many there are

  • 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!

Status
Not open for further replies.

BlackVen4m

New Member
Jul 19, 2021
7
0
1
27
Hello!
I don't know if it's possible, what I want is a command where the command I wrote will send a mesage showing how many foxes there are with the name "&cForest Fox" in the 200 block radius of player.

Code:
command /enfox <text>:
    trigger:
        if player is op:
            if arg 1 is "ext":
                spawn a fox at location of player
                set the display name of the spawned fox to "&cForest Fox"
            if arg 1 is "list":
                loop all entities in radius 200 around player:
                    if loop-entity is fox named "&cForest Fox":
                        message "&afound!"
                    else:
                        message "&cfailed!"
 
This should work, but if not idk

Code:
command /enfox <text>:
  trigger: 
    if player is op:
      if arg 1 is "ext":
        summon fox at location of player 
        set display name of last spawned entity to "Forest Fox"
      if arg 1 is "list":
        loop all entities in radius of 200 around player:
          if display name of loop-entity is "Forest Fox":
            if loop-entity is fox:
              add 1 to {forestfoxes}
              wait 1 ticks
              send "%{forestfoxes}% forest foxes within 200 blocks!" to player
              wait 1 tick
              set {forestfoxes} to 0
 
Hello!
I don't know if it's possible, what I want is a command where the command I wrote will send a mesage showing how many foxes there are with the name "&cForest Fox" in the 200 block radius of player.

Code:
command /enfox <text>:
    trigger:
        if player is op:
            if arg 1 is "ext":
                spawn a fox at location of player
                set the display name of the spawned fox to "&cForest Fox"
            if arg 1 is "list":
                loop all entities in radius 200 around player:
                    if loop-entity is fox named "&cForest Fox":
                        message "&afound!"
                    else:
                        message "&cfailed!"
Code:
command /enfox <text>:
    permission: op
    trigger:
        if arg-1 is "ext":
            spawn fox at location of player
            set display name of last spawned entity to "Forest Fox"
        else if arg-1 is "list":
            set {_} to size of (all foxes in radius 200 of player where [name of input is "Forest Fox"])
            send "%{_}% forest foxes are within 200 blocks of you!"
        else:
            send "&cInvalid arguments!"
 
Code:
command /enfox <text>:
    permission: op
    trigger:
        if arg-1 is "ext":
            spawn fox at location of player
            set display name of last spawned entity to "Forest Fox"
        else if arg-1 is "list":
            set {_} to size of (all foxes in radius 200 of player where [name of input is "Forest Fox"])
            send "%{_}% forest foxes are within 200 blocks of you!"
        else:
            send "&cInvalid arguments!"


Tsym it works! Hope you have a great day, and thanks for your help again! :emoji_grinning:
 
Status
Not open for further replies.