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

help me with / Stack Command

Discussion in 'Skript' started by GK_Nico, Oct 11, 2019.

  1. GK_Nico

    GK_Nico Member

    Joined:
    Jan 6, 2019
    Messages:
    20
    Likes Received:
    0
    Hey could anyone help me with / Stack Command?
    Unfortunately, do not get it and now I would like to ask you if who knows how to do it!



    PS: And please not only read but also give a tip!
     
  2. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    153
    Likes Received:
    7
    Send us a code Or Explain
     
  3. GK_Nico

    GK_Nico Member

    Joined:
    Jan 6, 2019
    Messages:
    20
    Likes Received:
    0
    For example, in essentials there is yes / stack command can you do with a script?
    I'm not a friend of essentials
     
  4. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    153
    Likes Received:
    7
    What does it does?
     
  5. GK_Nico

    GK_Nico Member

    Joined:
    Jan 6, 2019
    Messages:
    20
    Likes Received:
    0
    stack the items in the inventory for example player x gives "/ stack" and all the same items stack up i have no code to do it because i cant get it!
     
  6. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    153
    Likes Received:
    7
    Hmmm, Like /stack rswp diamond and it give me 64 DIamonds
     
  7. GK_Nico

    GK_Nico Member

    Joined:
    Jan 6, 2019
    Messages:
    20
    Likes Received:
    0
    Here's an example

    Code (Text):
    1. command /stack [<text>]:
    2.     permission: system.stack
    3.     permission message: &7[&eSkyBlock&7] &cDu hast keine Rechte dazu.
    4.     trigger:
    5.         send "&7[&eSkyBlock&7] &7Deine Items wurden gestackt!"
    6.         stack items of player's inventory

    Here again an example user x has in slot 1 Stone and in 4 again Stone as man knows it at essentials can enter /stack and thus stack the items
     
  8. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    153
    Likes Received:
    7
    Emmmmmm, I understanded, I'll make it and i'll reply Asap
    --- Double Post Merged, Oct 11, 2019, Original Post Date: Oct 11, 2019 ---
    Yo, Should i set {@prefix} for you to do not keep Writing The Prefix Many Times?
     
  9. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    153
    Likes Received:
    7
    Code (Skript):
    1.  
    2. options:
    3.     prefix:    &7[&eSkyblock&7]
    4. command stack [<text>]:
    5.     permission: system.stack
    6.     permission message: &7[&eSkyBlock&7] &cDu hast keine Rechte dazu.
    7.     trigger:
    8.         if arg 1 is set:
    9.             set {_item} to arg 1 parsed as item
    10.             set {_slot} to 0
    11.             loop 36 times:
    12.                 if slot {_slot} of player is {_item}:
    13.                     set {SB.Main::%player%} to {_slot}
    14.                     stop loop
    15.                 add 1 to {_slot}
    16.             set {_slotv2} to {SB.Main::%player%}
    17.             loop 36 times:
    18.                 if {SB.Main::%player%} is set:
    19.                     if slot {_slotv2} of player is {_item}:
    20.                         set {_THERE::%{_slotv2}%::NUMBER} to {_slotv2}
    21.                         set {_THERE::%{_slotv2}%} to slot {_THERE::%{_slotv2}%::NUMBER} of player
    22.                        
    23.                         set slot {_THERE::%{_slotv2}%::NUMBER} of player to air
    24.                         give player {_THERE::%{_slotv2}%}
    25.                 else:
    26.                     send "{@prefix} Item Not found, Make sure that you've typed the name correctly or You don't have it"
    27.                     stop trigger
    28.                 add 1 to {_slotv2}
    29.             send "{@prefix} Successfully Stacked Your Items!"
    30.             clear {SB.Main::%player%}
    31.                
    32.         else:
    33.             send "{@prefix} Select an item"
    34.  
    --- Double Post Merged, Oct 12, 2019, Original Post Date: Oct 11, 2019 ---
    Update: Added "all" method stack all items at once
    Code (Skript):
    1.  
    2. options:
    3.     prefix:    &7[&eSkyblock&7]
    4. command stack [<text>]:
    5.     permission: system.stack
    6.     permission message: &7[&eSkyBlock&7] &cDu hast keine Rechte dazu.
    7.     trigger:
    8.         if arg 1 is set:
    9.             if arg 1 is not "all":
    10.                 set {_item} to arg 1 parsed as item
    11.                 set {_slot} to 0
    12.                 loop 36 times:
    13.                     if slot {_slot} of player is {_item}:
    14.                         set {SB.Main::%player%} to {_slot}
    15.                         stop loop
    16.                     add 1 to {_slot}
    17.                 set {_slotv2} to {SB.Main::%player%}
    18.                 loop 36 times:
    19.                     if {SB.Main::%player%} is set:
    20.                         if slot {_slotv2} of player is {_item}:
    21.                             set {_THERE::%{_slotv2}%::NUMBER} to {_slotv2}
    22.                             set {_THERE::%{_slotv2}%} to slot {_THERE::%{_slotv2}%::NUMBER} of player
    23.                            
    24.                             set slot {_THERE::%{_slotv2}%::NUMBER} of player to air
    25.                             give player {_THERE::%{_slotv2}%}
    26.                     else:
    27.                         send "{@prefix} Item Not found, Make sure that you've typed the name correctly or You don't have it"
    28.                         stop trigger
    29.                     add 1 to {_slotv2}
    30.                 send "{@prefix} Successfully Stacked: &e%{_item}%&7!"
    31.                 clear {SB.Main::%player%}
    32.             else:
    33.                 set {_slot} to 0
    34.                 loop 36 times:
    35.                     if slot {_slot} of player is not air:
    36.                         set {_slotN::%{_slot}%} to {_slot}
    37.                         loop {_slotN::*}:
    38.                             if slot {_slotN::%loop-value-2%} of player is slot {_slot} of player:
    39.                                 set {_slotM::%loop-value-2%} to {_slot}
    40.                                 loop 36 times:
    41.                                     set {_SLOTTOGIVE} to slot {_slotM::%loop-value-2%} of player                          
    42.                                     set slot {_slotM::%loop-value-2%} of player to air
    43.                                     give player {_SLOTTOGIVE}
    44.                     add 1 to {_slot}              
    45.                 send "{@prefix} Successfully Stacked Your Items!"
    46.         else:
    47.             send "{@prefix} Select an item or type ""all"""
    48.  
     
Loading...