need help ASAP!! View player's inventory if the player is offline.

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

Stefqnutz

Active Member
Sep 23, 2019
67
1
8
19
Basically what i'm trying to make is when a player will leave, it will create a piston that contains his inventory. My problem is that it only shows the inventory of the player that actually clicked the piston, not the one that left the server.
Here is my code:
Code:
on disconnect:
    set {Stuff} to player's serialized inventory   
                                    
on disconnect:
    set block at player's location to piston

on right click on piston:
    restore inventory of player from {Stuff}
    set {_inv} to chest with 6 rows named "&fLoot"
    set {_inv}'s serialized contents to {Stuff}
    open {_inv} to player

on join:
    loop all blocks in radius 1 of player:
        if loop-block is piston:
            set loop-block to air
[doublepost=1603552298,1603539859][/doublepost]bump
[doublepost=1603615326][/doublepost]bump
[doublepost=1603616375][/doublepost]bump
 
I dont know whats ur Problem but why are you using {stuff} for everyone?
Every leave {stuff} will get overriden with another inventory.
 
Code:
on disconnect:
    set {Stuff.%player%} to player's serialized inventory 
                                  
on disconnect:
    set block at player's location to piston
 
on right click on piston:
    restore inventory of player from {Stuff.%player%}
    set {_inv.%player%} to chest with 6 rows named "&f%player%'s Items"
    set {_inv.%player%}'s serialized contents to {Stuff.%player%}
    open {_inv.%player%} to player
 
on join:
    loop all blocks in radius 1 of player:
        if loop-block is piston:
            set loop-block to air
 
Status
Not open for further replies.