Loops and format slor (GUI)

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

Juan7030

Member
Mar 20, 2017
13
0
0
30
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:
        if text arg 1 is "managechestsitems":
            if size of {FortCraft.chests.default::*} is not 0:
                set {chestitems.itemsinslots} to 0
                if  size of {FortCraft.chests.default::*} <= 9:
                    open chest with 1 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 18:
                    open chest with 2 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 27:
                    open chest with 3 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 36:
                    open chest with 4 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 45:
                    open chest with 5 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 54:
                    open chest with 6 row named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        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%"]
                        add 1 to {chestitems.itemsinslots}
                    set {chestitems.itemsinslots} to 0
                    stop

console error:
Code:
[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:')
 
Okay im using TusKe but i have errors.

Code:
        if text arg 1 is "managechestsitems":
            if size of {FortCraft.chests.default::*} is not 0:
                set {chestitems.itemsinslots} to 0
                if  size of {FortCraft.chests.default::*} <= 9:
                    open virtual chest inventory with 1 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 18:
                    open virtual chest inventory with 2 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 27:
                    open virtual chest inventory with 3 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 36:
                    open virtual chest inventory with 4 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 45:
                    open virtual chest inventory with 5 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
                if  size of {FortCraft.chests.default::*} <= 54:
                    open virtual chest inventory with 6 rows named "&fFortCraft &6ItemList" to player
                    loop {FortCraft.chests.default::*}:
                        add 1 to {chestitems.itemsinslots}
                        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%"
                    set {chestitems.itemsinslots} to 0
                    stop
            else:
                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)"

Console error:

Code:
[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
 
Status
Not open for further replies.