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.

Loops and format slor (GUI)

Discussion in 'Skript' started by Juan7030, Feb 6, 2018.

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

    Juan7030 Member

    Joined:
    Mar 20, 2017
    Messages:
    13
    Likes Received:
    0
    Hi guys!

    I'm trying to do that with a command, you can see the items that you set before, in this case I made a command in which you can save your items in a variable and I want that through a command, loop that variable and show saved items, could you help me? Thank you

    Code (Text):
    1.  
    2.         if text arg 1 is "managechestsitems":
    3.             if size of {FortCraft.chests.default::*} is not 0:
    4.                 set {chestitems.itemsinslots} to 0
    5.                 if  size of {FortCraft.chests.default::*} <= 9:
    6.                     open chest with 1 row named "&fFortCraft &6ItemList" to player
    7.                     loop {FortCraft.chests.default::*}:
    8.                         format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    9.                         add 1 to {chestitems.itemsinslots}
    10.                     set {chestitems.itemsinslots} to 0
    11.                     stop
    12.                 if  size of {FortCraft.chests.default::*} <= 18:
    13.                     open chest with 2 row named "&fFortCraft &6ItemList" to player
    14.                     loop {FortCraft.chests.default::*}:
    15.                         format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    16.                         add 1 to {chestitems.itemsinslots}
    17.                     set {chestitems.itemsinslots} to 0
    18.                     stop
    19.                 if  size of {FortCraft.chests.default::*} <= 27:
    20.                     open chest with 3 row named "&fFortCraft &6ItemList" to player
    21.                     loop {FortCraft.chests.default::*}:
    22.                         format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    23.                         add 1 to {chestitems.itemsinslots}
    24.                     set {chestitems.itemsinslots} to 0
    25.                     stop
    26.                 if  size of {FortCraft.chests.default::*} <= 36:
    27.                     open chest with 4 row named "&fFortCraft &6ItemList" to player
    28.                     loop {FortCraft.chests.default::*}:
    29.                         format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    30.                         add 1 to {chestitems.itemsinslots}
    31.                     set {chestitems.itemsinslots} to 0
    32.                     stop
    33.                 if  size of {FortCraft.chests.default::*} <= 45:
    34.                     open chest with 5 row named "&fFortCraft &6ItemList" to player
    35.                     loop {FortCraft.chests.default::*}:
    36.                         format slot {chestitems.itemsinslots} of player with loop-valuenamed "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    37.                         add 1 to {chestitems.itemsinslots}
    38.                     set {chestitems.itemsinslots} to 0
    39.                     stop
    40.                 if  size of {FortCraft.chests.default::*} <= 54:
    41.                     open chest with 6 row named "&fFortCraft &6ItemList" to player
    42.                     loop {FortCraft.chests.default::*}:
    43.                         format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]
    44.                         add 1 to {chestitems.itemsinslots}
    45.                     set {chestitems.itemsinslots} to 0
    46.                     stop
    47.  
    console error:
    Code (Text):
    1.  
    2. [18:13:13 ERROR]: [Skript] Can't understand this condition/effect: format slot {chestitems.itemsinslots} of player with "%loop-value%" named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"] (FortCraft!.sk, line 530: format slot {chestitems.itemsinslots} of player with "%loop-value%" named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There's no loop that matches 'loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove"' (FortCraft!.sk, line 537: format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There's no loop that matches 'loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove"' (FortCraft!.sk, line 544: format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There's no loop that matches 'loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove"' (FortCraft!.sk, line 551: format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There's no loop that matches 'loop-valuenamed "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove"' (FortCraft!.sk, line 558: format slot {chestitems.itemsinslots} of player with loop-valuenamed "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There's no loop that matches 'loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove"' (FortCraft!.sk, line 565: format slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to close then run [make player execute command "/Fortcraft removeitem %loop-value%"]') [18:13:13 ERROR]: [Skript] There is only one text argument in this command (FortCraft!.sk, line 572: if text arg 2 is set:')
    3.  
     
  2. Pikachu

    Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    139
    Medals:
    youb shouldn't be using format slot anyways. Use tuskes guis
     
    • Agree Agree x 1
  3. Juan7030

    Juan7030 Member

    Joined:
    Mar 20, 2017
    Messages:
    13
    Likes Received:
    0
    Thanks, i will try that.
    --- Double Post Merged, Feb 7, 2018, Original Post Date: Feb 7, 2018 ---
    Could you help me how i can set a gui? :emoji_stuck_out_tongue:
     
  4. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    • Agree Agree x 1
  5. Juan7030

    Juan7030 Member

    Joined:
    Mar 20, 2017
    Messages:
    13
    Likes Received:
    0
    Okay im using TusKe but i have errors.

    Code (Text):
    1.  
    2.         if text arg 1 is "managechestsitems":
    3.             if size of {FortCraft.chests.default::*} is not 0:
    4.                 set {chestitems.itemsinslots} to 0
    5.                 if  size of {FortCraft.chests.default::*} <= 9:
    6.                     open virtual chest inventory with 1 rows named "&fFortCraft &6ItemList" to player
    7.                     loop {FortCraft.chests.default::*}:
    8.                         add 1 to {chestitems.itemsinslots}
    9.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    10.                     set {chestitems.itemsinslots} to 0
    11.                     stop
    12.                 if  size of {FortCraft.chests.default::*} <= 18:
    13.                     open virtual chest inventory with 2 rows named "&fFortCraft &6ItemList" to player
    14.                     loop {FortCraft.chests.default::*}:
    15.                         add 1 to {chestitems.itemsinslots}
    16.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    17.                     set {chestitems.itemsinslots} to 0
    18.                     stop
    19.                 if  size of {FortCraft.chests.default::*} <= 27:
    20.                     open virtual chest inventory with 3 rows named "&fFortCraft &6ItemList" to player
    21.                     loop {FortCraft.chests.default::*}:
    22.                         add 1 to {chestitems.itemsinslots}
    23.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    24.                     set {chestitems.itemsinslots} to 0
    25.                     stop
    26.                 if  size of {FortCraft.chests.default::*} <= 36:
    27.                     open virtual chest inventory with 4 rows named "&fFortCraft &6ItemList" to player
    28.                     loop {FortCraft.chests.default::*}:
    29.                         add 1 to {chestitems.itemsinslots}
    30.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    31.                     set {chestitems.itemsinslots} to 0
    32.                     stop
    33.                 if  size of {FortCraft.chests.default::*} <= 45:
    34.                     open virtual chest inventory with 5 rows named "&fFortCraft &6ItemList" to player
    35.                     loop {FortCraft.chests.default::*}:
    36.                         add 1 to {chestitems.itemsinslots}
    37.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    38.                     set {chestitems.itemsinslots} to 0
    39.                     stop
    40.                 if  size of {FortCraft.chests.default::*} <= 54:
    41.                     open virtual chest inventory with 6 rows named "&fFortCraft &6ItemList" to player
    42.                     loop {FortCraft.chests.default::*}:
    43.                         add 1 to {chestitems.itemsinslots}
    44.                         format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"
    45.                     set {chestitems.itemsinslots} to 0
    46.                     stop
    47.             else:
    48.                 send "&6FortCraft&c&l>&6&l>&7 You need set the items first!, do &c/FortCraft addchestitems&7 for set the items &8(You need have items in your inventory)"
    49.  
    50.  
    Console error:

    Code (Text):
    1.  
    2. [21:03:43 ERROR]: There's no loop that matches 'loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"' (FortCraft!.sk, line 531: format gui slot {chestitems.itemsinslots} of player with loop-value named "&9" with the lore "&9%loop-value% || &6Clic here to &cRemove" to run console command "/Fortcraft removeitem %loop-value%"') #This continues like this with all the format slots that I placed
    3.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...