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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Requests' started by komaitachi, Sep 18, 2018.

  1. komaitachi

    komaitachi Member

    Joined:
    Sep 18, 2018
    Messages:
    2
    Likes Received:
    0
    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
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    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 (Skript):
    1. on world change:
    2.     if event-world is not "xyz":
    3.         set {InvLocSaver::%player%::loc} to past event-location
    4.         loop 41 times:
    5.             set {InvLocSaver::%player%::Slot::%loop-number - 1%} to slot loop-number - 1 of inventory of player
    6.            
    7.  
    8.  
    9. command /backinventory:
    10.     aliases: back
    11.     trigger:
    12.         teleport player to {InvLocSaver::%player%::loc}
    13.         loop 41 times:
    14.             set slot loop-number - 1 of inventory of player to {InvLocSaver::%player%::Slot::%loop-number - 1%}
     
  3. komaitachi

    komaitachi Member

    Joined:
    Sep 18, 2018
    Messages:
    2
    Likes Received:
    0
    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
     

Share This Page

Loading...