Jump to content

'if (variable list) contains event-entity:' recognizing other things in the list?


Amaestin

Recommended Posts

So i tried to make npc skript where when I create a npc in-game then when you click the npc it'll make you do the command but when there's multiple ids and then try to click them it recognized the other ids aswell as the current one. 

when i click one of the npcs which is a zombie (test), it somehow finds the villager (test2) and does the command that test2 is supposed to do but when i click the zombie it's not supposed to do that

image.png.722f930dcef62fb2839dcfa9ec1a9346.png

 

 

on right click:
    if {npc::*} contains clicked entity: # this is to see if the npc is a npc. this works i think
        loop {npcs::*}: # this loops the ids
            if {npc::*} contains clicked entity: # this is supposed to look if the id links to the entity but it seems to not work when i click the zombie (test)?
                player command "%{npccommand::%loop-value%}%" # this is just the command it's supposed to do if it finds the correct entity.
                message "%loop-value%" to player # this is just to see what the end result should be.

 

 

Edited by Amaestin
Link to comment
Share on other sites

13 hours ago, Amaestin said:

So i tried to make npc skript where when I create a npc in-game then when you click the npc it'll make you do the command but when there's multiple ids and then try to click them it recognized the other ids aswell as the current one. 

when i click one of the npcs which is a zombie (test), it somehow finds the villager (test2) and does the command that test2 is supposed to do but when i click the zombie it's not supposed to do that

Im not sure. Does it work if you replace 

%{npccommand::%loop-value%}%

with a real command. Example /say hi

 

imgonline-com-ua-resize-CNNkL1drx5M-removebg-preview.png.d6a8ae8b5eb862005fb056c21f934200.png

Link to comment
Share on other sites

1 hour ago, LapEvents said:

Im not sure. Does it work if you replace 

%{npccommand::%loop-value%}%

with a real command. Example /say hi

now i understand ok what u need to do is- oh he alr ansered

  • Haha 1

Every time you tell a lie, You'll have to tell a 100 more.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...