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.

Solved why does my loop not wort

Discussion in 'Skript' started by tim hilton-brown, Sep 11, 2021.

Thread Status:
Not open for further replies.
  1. tim hilton-brown

    Joined:
    Nov 9, 2020
    Messages:
    2
    Likes Received:
    0
    i made this code for my server:
    (ignore the messages)

    command /start:
    trigger:
    loop all players every 30 minutes:
    set {_num.%player%} to random integer between 1 and 10
    set max health of all players to 10
    remove speed from all players
    remove jump boost from all players
    remove invisibility from all players
    remove slowness from all players
    remove strength from all players
    remove weakness from all players
    remove resistance from all players
    remove mining fatigue from all players
    remove slow falling from all players
    if {_num.%player%} is 1:
    apply invisibility to player for 1 day
    message "&2now you are &b&linvisibility" to the player
    if {_num.%player%} is 2:
    apply jump boost of tier 2 to player for 1 day
    apply speed of tier 2 to player for 1 day
    message "&2you are &b&obouncey" to the player
    if {_num.%player%} is 3:
    set max health of player to 6
    message "&cyou have like no &2health &6nob" to the player
    if {_num.%player%} is 4:
    set max health of player to 12
    message "&2youreeee health goes &1&lSTONKSSSSS" to the player
    if {_num.%player%} is 5:
    apply slowness of tier 1 to player for 1 day
    message "&4you will never get to me &5slow ass" to the player
    if {_num.%player%} is 6:
    apply strength of tier 1 to player for 1 day
    message "&1you have strength. because &4&lyou are bad at the game. " to the player
    if {_num.%player%} is 7:
    apply weakness of tier 2 to player for 1 day
    message "&1you are &cfucking &d&lweak" to the player
    if {_num.%player%} is 8:
    apply resistance to player for 1 day
    message "&4damege &r= &5no" to the player
    if {_num.%player%} is 9:
    apply mining fatigue to player for 1 day
    message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the player
    if {_num.%player%} is 10:
    apply slow falling to player for 1 day
    message "&1&lhah&5!&4&e you fall slow" to the player
    stop

    i dont know why but it doesent work.
    the eror says that theres no spesific player. but i made a loop all players. please help!

     
    #1 tim hilton-brown, Sep 11, 2021
    Last edited: Sep 11, 2021
  2. Best Answer:
    Post #5 by TheCubPlays, Sep 14, 2021
  3. ShyDoge

    ShyDoge Member

    Joined:
    Jul 31, 2021
    Messages:
    41
    Likes Received:
    1
    Replace all "Player" text with "loop-player"
    Code (Text):
    1. command /start:
    2.   trigger:
    3.     loop all players every 30 minutes:
    4.       set {_num.%player%} to random integer between 1 and 10
    5.       set max health of all players to 10
    6.       remove speed from all players
    7.       remove jump boost from all players
    8.       remove invisibility from all players
    9.       remove slowness from all players
    10.       remove strength from all players
    11.       remove weakness from all players
    12.       remove resistance from all players
    13.       remove mining fatigue from all players
    14.       remove slow falling from all players
    15.       if {_num.%player%} is 1:
    16.       apply invisibility to player for 1 day
    17.       message "&2now you are &b&linvisibility" to the player
    18.       if {_num.%player%} is 2:
    19.       apply jump boost of tier 2 to player for 1 day
    20.       apply speed of tier 2 to player for 1 day
    21.       message "&2you are &b&obouncey" to the player
    22.       if {_num.%player%} is 3:
    23.         set max health of player to 6
    24.         message "&cyou have like no &2health &6nob" to the player
    25.         if {_num.%player%} is 4:
    26.           set max health of player to 12
    27.           message "&2youreeee health goes &1&lSTONKSSSSS" to the player
    28.            if {_num.%player%} is 5:
    29.              apply slowness of tier 1 to player for 1 day
    30.              message "&4you will never get to me &5slow ass" to the player
    31.               if {_num.%player%} is 6:
    32.                 apply strength of tier 1 to player for 1 day
    33.                 message "&1you have strength. because &4&lyou are bad at the game. " to the player
    34.                 if {_num.%player%} is 7:
    35.                   apply weakness of tier 2 to player for 1 day
    36.                   message "&1you are &cfucking &d&lweak" to the player
    37.                    if {_num.%player%} is 8:
    38.                      apply resistance to player for 1 day
    39.                      message "&4damege &r= &5no" to the player
    40.                      if {_num.%player%} is 9:
    41.                        apply mining fatigue to loop-player for 1 day
    42.                        message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the loop-player
    43.                        if {_num.%loop-player%} is 10:
    44.                          apply slow falling to loop-player for 1 day
    45.                          message "&1&lhah&5!&4&e you fall slow" to the loop-player
    46. stop
    also no i didnt do the work i just tabbed all your things in
     
    #2 ShyDoge, Sep 13, 2021
    Last edited: Sep 13, 2021
  4. tim hilton-brown

    Joined:
    Nov 9, 2020
    Messages:
    2
    Likes Received:
    0
    the code dosent work.
    Code (Text):
    1.  
    2. command /start:
    3.   trigger:
    4.     loop all players every 30 minutes:
    5.       set {_num.%loop-player%} to random integer between 1 and 10
    6.       set max health of loop-player to 10
    7.       remove speed from loop-player
    8.       remove jump boost from loop-player
    9.       remove invisibility from loop-player
    10.       remove slowness from loop-player
    11.       remove strength from loop-player
    12.       remove weakness from loop-player
    13.       remove resistance from loop-player
    14.       remove mining fatigue from loop-player
    15.       remove slow falling from loop-player
    16.       if {_num.%loop-player%} is 1:
    17.         apply invisibility to loop-player for 1 day
    18.         message "&2now you are &b&linvisibility" to the loop-player
    19.       if {_num.%loop-player%} is 2:
    20.         apply jump boost of tier 2 to loop-player for 1 day
    21.         apply speed of tier 2 to loop-player for 1 day
    22.         message "&2you are &b&obouncey" to the loop-player
    23.       if {_num.%loop-player%} is 3:
    24.         set max health of loop-player to 6
    25.         message "&cyou have like no &2health &6nob" to the loop-player
    26.       if {_num.%loop-player%} is 4:
    27.         set max health of loop-player to 12
    28.         message "&2youreeee health goes &1&lSTONKSSSSS" to the loop-player
    29.       if {_num.%loop-player%} is 5:
    30.         apply slowness of tier 1 to loop-player for 1 day
    31.         message "&4you will never get to me &5slow ass" to the loop-player
    32.       if {_num.%loop-player%} is 6:
    33.         apply strength of tier 1 to loop-player for 1 day
    34.         message "&1you have strength. because &4&lyou are bad at the game. " to the loop-player
    35.       if {_num.%loop-player%} is 7:
    36.         apply weakness of tier 2 to loop-player for 1 day
    37.         message "&1you are &cfucking &d&lweak" to the loop-player
    38.       if {_num.%loop-player%} is 8:
    39.         apply resistance to loop-player for 1 day
    40.         message "&4damege &r= &5no" to the loop-player
    41.       if {_num.%loop-player%} is 9:
    42.         apply mining fatigue to loop-player for 1 day
    43.         message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the loop-player
    44.       if {_num.%loop-player%} is 10:
    45.         apply slow falling to loop-player for 1 day
    46.         message "&1&lhah&5!&4&e you fall slow" to the loop-player
    47. stop
    48. stop
    it says that it can not understand the loop
     
  5. ShyDoge

    ShyDoge Member

    Joined:
    Jul 31, 2021
    Messages:
    41
    Likes Received:
    1
    remove the 2 stops at the end.
     
  6. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    35
    Likes Received:
    3
    Is it even possible to make it work every 30 minutes like that? Try this instead:

    Code (Text):
    1. command /start:
    2.   trigger:
    3.     set {variable} to true
    4. every 30 minutes:
    5.   if {variable} is true:
    6.     loop all players:
    7.       set {_num.%loop-player%} to random integer between 1 and 10
    8.       set max health of loop-player to 10
    9.       remove speed from loop-player
    10.       remove jump boost from loop-player
    11.       remove invisibility from loop-player
    12.       remove slowness from loop-player
    13.       remove strength from loop-player
    14.       remove weakness from loop-player
    15.       remove resistance from loop-player
    16.       remove mining fatigue from loop-player
    17.       remove slow falling from loop-player
    18.       if {_num.%loop-player%} is 1:
    19.        apply invisibility to loop-player for 1 day
    20.        message "&2now you are &b&linvisibility" to the loop-player
    21.       if {_num.%loop-player%} is 2:
    22.        apply jump boost of tier 2 to loop-player for 1 day
    23.        apply speed of tier 2 to loop-player for 1 day
    24.        message "&2you are &b&obouncey" to the loop-player
    25.       if {_num.%loop-player%} is 3:
    26.        set max health of loop-player to 6
    27.        message "&cyou have like no &2health &6nob" to the loop-player
    28.       if {_num.%loop-player%} is 4:
    29.        set max health of loop-player to 12
    30.        message "&2youreeee health goes &1&lSTONKSSSSS" to the loop-player
    31.       if {_num.%loop-player%} is 5:
    32.        apply slowness of tier 1 to loop-player for 1 day
    33.        message "&4you will never get to me &5slow ass" to the loop-player
    34.       if {_num.%loop-player%} is 6:
    35.        apply strength of tier 1 to loop-player for 1 day
    36.        message "&1you have strength. because &4&lyou are bad at the game. " to the loop-player
    37.       if {_num.%loop-player%} is 7:
    38.        apply weakness of tier 2 to loop-player for 1 day
    39.        message "&1you are &cfucking &d&lweak" to the loop-player
    40.       if {_num.%loop-player%} is 8:
    41.        apply resistance to loop-player for 1 day
    42.        message "&4damege &r= &5no" to the loop-player
    43.       if {_num.%loop-player%} is 9:
    44.        apply mining fatigue to loop-player for 1 day
    45.        message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the loop-player
    46.       if {_num.%loop-player%} is 10:
    47.        apply slow falling to loop-player for 1 day
    48.        message "&1&lhah&5!&4&e you fall slow" to the loop-player
    49.  
    Just realised what you meant, edited the code. Try and see if this works.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...