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.

loop and give player items

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

Tags:
  1. X

    XSKRIPTX Active Member

    Joined:
    Dec 26, 2017
    Messages:
    29
    Likes Received:
    1
    Hello i have

    Code (Text):
    1. set {test.lvl.1::*} to items in the player's inventory
    2. set player's inventory to {test.lvl.1::*}
    but i will have

    loop {mw.lvl.%player's level%::*} and give player all looped items of {mw.lvl.%player's level%::*}

    can anybody make a Example or help me
    --- Double Post Merged, Oct 11, 2019, Original Post Date: Oct 11, 2019 ---
    NEWS:
    my test code but it doesnt work
    Code (Text):
    1. loop all items of inventory of {test.lvl.1::*}:
    2.         give player "%loop-index%"
     
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    150
    Likes Received:
    15
    Example:
    Code (Skript):
    1. command /saveinv:
    2.     trigger:
    3.         delete {test.lvl.1::*}
    4.         set {_slot} to 0
    5.         loop 36 times:
    6.             add slot {_slot} of player's inventory to {test.lvl.1::*}
    7.             add 1 to {_slot}
    8.  
    9. command /retrieve:
    10.     trigger:
    11.         set {_c} to 0
    12.         loop {test.lvl.1::*}:
    13.             set slot {_c} of player's inventory to loop-value
    14.             add 1 to {_c}
     
Loading...