Solved why does my loop not wort

  • 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.
Nov 9, 2020
2
0
1
23
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!
 
Last edited:
Replace all "Player" text with "loop-player"
Code:
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 loop-player for 1 day
                       message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the loop-player
                       if {_num.%loop-player%} is 10:
                         apply slow falling to loop-player for 1 day
                         message "&1&lhah&5!&4&e you fall slow" to the loop-player
stop
also no i didnt do the work i just tabbed all your things in
 
Last edited:
Replace all "Player" text with "loop-player"
Code:
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 loop-player for 1 day
                       message "&4you cant mine!&c yeah cry it out you &lugly fuck" to the loop-player
                       if {_num.%loop-player%} is 10:
                         apply slow falling to loop-player for 1 day
                         message "&1&lhah&5!&4&e you fall slow" to the loop-player
stop
also no i didnt do the work i just tabbed all your things in

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

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

it says that it can not understand the loop
remove the 2 stops at the end.
 
Is it even possible to make it work every 30 minutes like that? Try this instead:

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

it says that it can not understand the loop
 
  • Like
Reactions: mrclipse
Status
Not open for further replies.