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.

Saved players inventory are duping itens

Discussion in 'Skript' started by Nodio, May 12, 2019.

  1. N

    Nodio Member

    Joined:
    Sep 22, 2018
    Messages:
    2
    Likes Received:
    0
    i have this code

    Code (Text):
    1.  
    2. command /mostrarinv:
    3.     trigger:
    4.         if player has permission "vip.inv2":
    5.             if {stuff:%player%::*} exists:
    6.                 open chest with 6 rows named "Saved Inventory" to player
    7.                 set {_slot} to -1
    8.                 loop {stuff:%player%::*}:
    9.                     add 1 to {_slot}
    10.                     set slot {_slot} of player's current inventory to loop-value
    11.             else:
    12.                 send "&6Você não tem nenhum item salvo"
    13.         else:
    14.             send "&6Sem permissão - Apenas Vips"
    15. command /salvarinv:
    16.     trigger:
    17.         if player has permission "vip.inv2":
    18.             if {stuff:%player%::*} exists:
    19.                 send "Você ja tem um inventário salvo, Apagando inventário anterior"
    20.                 delete {stuff:%player%::*}
    21.             loop all items in player's inventory:
    22.                 lore of loop-item contains "Intransferivel"
    23.                 add loop-item to {stuff:%player%::*}
    24.                 remove loop-item from the player
    25.                 #clear the player's inventory
    26.             send "&a&l[✓] &fSalvos &7&o%size of {stuff:%player%::*}%&r&f items."
    27.         else:
    28.             send "&6Sem permissão - Apenas Vips"
    29.  
    30.  
    but when i get back the itens on {stuff:%player%::*}, it back to have same itens, even if i erase that, duping all
    --- Double Post Merged, May 14, 2019, Original Post Date: May 12, 2019 ---
    someone pls?
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    1,760
    Likes Received:
    124
    1) The use of a single colon does not work. {stuff:%player%} is incorrect. Double up your colons to properly use list variables
    2) You will need to use an inventory close event to save the current state of that inventory when they close out of that inventory
     
  3. N

    Nodio Member

    Joined:
    Sep 22, 2018
    Messages:
    2
    Likes Received:
    0
    i will close that inventory by its name on event? could you please post an example, thx by the way
     
  4. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,014
    Likes Received:
    60
    Medals:
Loading...