1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Message repeat in a loop

Discussion in 'Skript' started by Lummox, Feb 27, 2020.

Thread Status:
Not open for further replies.
  1. Lummox

    Lummox Member

    Joined:
    Jan 29, 2017
    Messages:
    28
    Likes Received:
    0
    Code (Text):
    1. every 5 seconds:
    2.     loop all players:
    3.         loop blocks in radius 5 around loop-player:
    4.             loop-block is a fire or lava:
    5.                 add player to {temperatura.fuego::*}
    6.                 add 0.25 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
    7.                 send "&aFuego si -> Recibe calor: &e%{temperatura.fuego.%loop-player%}%" to loop-player
    8.             loop-block is torch:
    9.                 add player to {temperatura.antorchasuelo::*}
    10.                 add 0.25 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
    11.                 send "&aFuego antorcha suelo si -> Recibe calor: &e%{temperatura.antorchasuelo.%loop-player%}%" to loop-player
    12.             loop-player is holding a torch:
    13.                 add player to {temperatura.antorchamano::*}
    14.                 add 0.1 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
    15.                 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 (Text):
    1. every 5 second:
    2.     loop all players:
    3.         loop-player is holding a torch:
    4.             add player to {temperatura.antorchamano::*}
    5.             add 0.1 to {temperatura.actual.%loop-player%} if {temperatura.actual.%loop-player%} < 37.4
    6.             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?
     
  2. MrGametop1

    MrGametop1 Member

    Joined:
    Mar 10, 2017
    Messages:
    36
    Likes Received:
    0
    Maybe try with loop-player's tool
     
Thread Status:
Not open for further replies.

Share This Page

Loading...