[Skript] Save Inventory And Location When Out In Certain World

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

komaitachi

Member
Sep 18, 2018
2
0
0
23
Category: Skript

Suggested name: InventoryLocationSaver

What I want:
When player out server in world name "xyz" , server will set his inventory and location to {playername.inventory} , ...

And when use a command /backinventory . /back , it will teleport to the location and backup inventory


Ideas for commands: /backinventory . /back

Ideas for permissions: backinventory.admin , back.admin

When I'd like it by: For some server survival :3
 
I wasn't sure what you meant by "When player out server in world" ... were you meaning teleport to another world?
IF thats the case I wrote this
code_language.skript:
on world change:
    if event-world is not "xyz":
        set {InvLocSaver::%player%::loc} to past event-location
        loop 41 times:
            set {InvLocSaver::%player%::Slot::%loop-number - 1%} to slot loop-number - 1 of inventory of player
            


command /backinventory:
    aliases: back
    trigger:
        teleport player to {InvLocSaver::%player%::loc}
        loop 41 times:
            set slot loop-number - 1 of inventory of player to {InvLocSaver::%player%::Slot::%loop-number - 1%}
 
I wasn't sure what you meant by "When player out server in world" ... were you meaning teleport to another world?
IF thats the case I wrote this
code_language.skript:
on world change:
    if event-world is not "xyz":
        set {InvLocSaver::%player%::loc} to past event-location
        loop 41 times:
            set {InvLocSaver::%player%::Slot::%loop-number - 1%} to slot loop-number - 1 of inventory of player
           


command /backinventory:
    aliases: back
    trigger:
        teleport player to {InvLocSaver::%player%::loc}
        loop 41 times:
            set slot loop-number - 1 of inventory of player to {InvLocSaver::%player%::Slot::%loop-number - 1%}

i mean ........ when players leave the server, and at that time, if they are in the world have name "xyz", keep their inventory, if not cancel event
Btw , thanks for help :3