Solved loop-players

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

    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.

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
Hey guys,
I got a problem with loop-players

This is my code:

code_language.skript:
                loop players in radius 5 around player:
                    if loop-player exists:
                        if "%loop-value%" is arg-1:
                            if arg-1 parsed as a player's gamemode is not creative:
                                kill arg-1 parsed as a player
                                remove 1 enchanted book named "&cDeathnote" with lore "&7Command: /deathnote <player>" from the player
                                broadcast "&c&l%player% killed %arg-1%!"
                            else:
                                message "&cPls don't kill creative ppl :c"
                        else:
                            send "&a%arg-1% is not in range!"


But if i run the skript, it will send the message --%arg-1% is not in range!-- with every player it loops.
But is it possible that it will check if arg-1 is within all the players in radius and if he is not, that it will just run the message that he isnt in range just one time. like not send the message with every single looped player.

Can you guys help?
 
code_language.skript:
if distance between player and arg-1 is less than 5:
    do stuff
else:
    send "not in range"
 
Status
Not open for further replies.