Solved If loop-entity is set

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

PatoFrango

Active Member
Jul 12, 2017
240
14
18
Hi,

I'm coding a thing that loops all armor stands in radius of a block. What I want to do is, if it finds indeed an armor stand, it sends a message saying "Test". If not, it sends "lol".

The thing is, when it's supposed to say "lol", in other words, when no armor stand is found, simply nothing happens. No errors detected on reload. I feel like I've done this before, 'cause it's not the most complicated of the tasks, I just don't remember how I did it.
code_language.skript:
loop all armor stands in radius 2 of {_block}:
    if loop-entity is set:
        send "{@prefix} &cTest"
    else:
        send "lol" to player
 
Last edited:
loop entity will always be set because it wont loop if there are no armorstands
 
Try
code_language.skript:
loop all armor stands in radius 2 of {_block}:
    set {_msg} to "{@prefix} &cTest"
message {_msg} if {_msg} is set, else "lol"
 
Try
code_language.skript:
loop all armor stands in radius 2 of {_block}:
    set {_msg} to "{@prefix} &cTest"
message {_msg} if {_msg} is set, else "lol"
I had already tried something like that, and it worked. Yes, the issue was what Donut said. Thank you both.
code_language.skript:
loop all armor stands in radius 2 of {_block}:
    if loop-entity is set:
        send "{@prefix} &cTest"
        set {_found} to true
if {_found} is not set:
    # code
 
Status
Not open for further replies.