Loop + else = Buggy

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

MeHow

Active Member
Feb 6, 2017
140
13
18
22
Lithuania
Hello guys I have this code:
code_language.skript:
every second:
    loop all players:
        loop all blocks in radius 5 of loop-player:
            if loop-player is wearing iron helmet:
                stop loop
            else:
                if loop-block is sign:
                    if line 2 of loop-block is "Oxygen":
                        stop loop
                else:
                    damage loop-player by 0.5 heart
                    stop
I have no errors Skript version: 2.2, Minecraft: 1.8 and it's so buggy I don't know why...
If i am in chamber with sign and without iron helmet it's still damage me :emoji_frowning:.
Thanks for help
 
Hello guys I have this code:
code_language.skript:
every second:
    loop all players:
        loop all blocks in radius 5 of loop-player:
            if loop-player is wearing iron helmet:
                stop loop
            else:
                if loop-block is sign:
                    if line 2 of loop-block is "Oxygen":
                        stop loop
                else:
                    damage loop-player by 0.5 heart
                    stop
I have no errors Skript version: 2.2, Minecraft: 1.8 and it's so buggy I don't know why...
If i am in chamber with sign and without iron helmet it's still damage me :emoji_frowning:.
Thanks for help


I think it might be couse that its a wall sign instead of an stand sign so replace if loop-block is sign: with if loop-block is a wall sign:
 
If player isnt wearing helmet and around player is a sign with text oxygen don't damage if player isn't wearing damage player
 
Status
Not open for further replies.