Add inventory to list variable?

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

Avaplays

Member
Jan 29, 2017
23
2
3
29
code_language.skript:
        set {combat_log::inventory::%{_id}%::*} to serialized contents of player's inventory
        add player's helmet to {combat_log::inventory::%{_id}%::*}
        add player's chestplate to {combat_log::inventory::%{_id}%::*}
        add player's leggings to {combat_log::inventory::%{_id}%::*}
        add player's boots to {combat_log::inventory::%{_id}%::*}

I don't know why, but "serialized contents of player's inventory" doesn't work for me..

code_language.skript:
        loop {combat_log::inventory::%{_id}%::*}:
            drop loop-value at location of victim

I tried to drop but there's nothing.


Maybe you can help me to equip a citizen too because "equip citizen id with an %item stack%" doesn't seems to work too.

Thanks :3
 
serialized contents has been broken for a while now
https://forums.skunity.com/resources/region-inventories.294/
take a look at that I haven't looked at it but it prob has what u want

Thanks, i downloaded this just this morning xd...


code_language.skript:
        loop items in player's inventory:
            add loop-value to {combat_log::inventory::%{_id}%::*}

This works but now i have the Problem with dropping...

code_language.skript:
        loop {combat_log::inventory::%{_id}%::*}:
            drop loop-value at {_location}

It drops nothing.. (when i send "%loop-value%" all is listed..)

Any idea?
 
code_language.skript:
on death:
    if citizen id of victim is set:
        set {_id} to citizen id of victim
        set {_location} to location of victim
        remove citizen {_id}
        loop {combat_log::inventory::%{_id}%::*}:
            drop loop-value parsed as item at location {_location}
        delete {combat_log::inventory::%{_id}%::*}

I tryed but it doesn't works too.. If i send a message with the loop-value, there's a result with the items of my inventory.. but they can't drop.. any alternative?
 
You just need loop all slots(by number, it will count armor too) of citizen. then if "%slot loop-number of player's inventory%" is not "<None>":, add slot loop-number player's inventory to {Items::%{_id}%::*} and you dont need parse item
 
Status
Not open for further replies.