Message repeat in a loop

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

Lummox

Member
Jan 29, 2017
28
0
1
42
Code:
every 5 seconds:
    loop all players:
        loop blocks in radius 5 around loop-player:
            loop-block is a fire or lava:
                add player to {temperatura.fuego::*}
                add 0.25 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
                send "&aFuego si -> Recibe calor: &e%{temperatura.fuego.%loop-player%}%" to loop-player
            loop-block is torch:
                add player to {temperatura.antorchasuelo::*}
                add 0.25 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
                send "&aFuego antorcha suelo si -> Recibe calor: &e%{temperatura.antorchasuelo.%loop-player%}%" to loop-player
            loop-player is holding a torch:
                add player to {temperatura.antorchamano::*}
                add 0.1 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
                send "&aAntorcha en mano si -> Recibe calor: &e%{temperatura.antorchamano.%loop-player%}%" to loop-player

Everything works fine until it reaches the last condition. It works but the last message repeats it in an infinite loop. The code continues, so I can not place a stop at the end (also, if I do the two conditions above do not work).

On the other hand, if I execute the same code of the last condition apart, everything works fine.

Code:
every 5 second:
    loop all players:
        loop-player is holding a torch:
            add player to {temperatura.antorchamano::*}
            add 0.1 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
            send "&aAntorcha en mano si -> Recibe calor: &e%{temperatura.antorchamano.%loop-player%}%" to loop-player

The message is not repeated, it only shows it once (as expected).

Where is the problem?
 
Status
Not open for further replies.