Solved Loop Citizen NPC Question

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

ItsSniper

New Member
Feb 3, 2017
5
0
1
Hello everyone! I was searching the docs, but couldn't find something, so I was wondering if any of you could help me out. Basically, I want to know if it is possible to loop citizens by names or IDs in the radius of a player. Here is my example (Not working, just an idea of what I mean):

code_language.skript:
on any movement:
    if {test.%player%} is set:
        loop all citizens in radius 5 of player:              # Not working
            if loop-citizen is not "Test":                    # Not working
                delete {test.%player%}
                message "Bye" to player

If anyone has a solution to this, that would be awesome. Thanks, and have a great day! :emoji_slight_smile:
 
Hello everyone! I was searching the docs, but couldn't find something, so I was wondering if any of you could help me out. Basically, I want to know if it is possible to loop citizens by names or IDs in the radius of a player. Here is my example (Not working, just an idea of what I mean):

code_language.skript:
on any movement:
    if {test.%player%} is set:
        loop all citizens in radius 5 of player:              # Not working
            if loop-citizen is not "Test":                    # Not working
                delete {test.%player%}
                message "Bye" to player

If anyone has a solution to this, that would be awesome. Thanks, and have a great day! :emoji_slight_smile:

If you set the entity type of the citizen to "PLAYER" , you can just loop the players.

Like:
code_language.skript:
command /testing:
    trigger:
        set {_npc} to a npc with name "test" and entity type PLAYER
        spawn npc {_npc} at player's location
 
If you set the entity type of the citizen to "PLAYER" , you can just loop the players.

Like:
code_language.skript:
command /testing:
    trigger:
        set {_npc} to a npc with name "test" and entity type PLAYER
        spawn npc {_npc} at player's location
Thanks a ton. I really didn't think about this. I was trying to make it harder than it actually was. I appreciate the help :emoji_slight_smile:
 
Status
Not open for further replies.