Saved players inventory are duping itens

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

Nodio

Member
Sep 22, 2018
3
0
0
42
i have this code

Code:
command /mostrarinv:
    trigger:
        if player has permission "vip.inv2":
            if {stuff:%player%::*} exists:
                open chest with 6 rows named "Saved Inventory" to player
                set {_slot} to -1
                loop {stuff:%player%::*}:
                    add 1 to {_slot}
                    set slot {_slot} of player's current inventory to loop-value
            else:
                send "&6Você não tem nenhum item salvo"
        else:
            send "&6Sem permissão - Apenas Vips"
command /salvarinv:
    trigger:
        if player has permission "vip.inv2":
            if {stuff:%player%::*} exists:
                send "Você ja tem um inventário salvo, Apagando inventário anterior"
                delete {stuff:%player%::*}
            loop all items in player's inventory:
                lore of loop-item contains "Intransferivel"
                add loop-item to {stuff:%player%::*}
                remove loop-item from the player
                #clear the player's inventory
            send "&a&l[✓] &fSalvos &7&o%size of {stuff:%player%::*}%&r&f items."
        else:
            send "&6Sem permissão - Apenas Vips"

but when i get back the itens on {stuff:%player%::*}, it back to have same itens, even if i erase that, duping all
[doublepost=1557840339,1557686566][/doublepost]someone pls?
 
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
 
i will close that inventory by its name on event? could you please post an example, thx by the way
 
Status
Not open for further replies.