Jump to content

How do i save a player's inventory when they choose to go on other gamemodes?


Recommended Posts

Hello! I am new to skript and I am actually trying to make a minehut server with multiple gamemodes/minigames. I can't find out how to save a player's inventory. Example: I have a world for mining called "Mines". I have another world called "Lobby2". How can I do so, that if the player goes to "Lobby2", his inventory is deleted, and when he goes back to "Mines", he has everything back. Sorry if i did some spelling mistakes, but i am from a different country. Thanks! (Need help really quick. I mean in 5h.).

Link to comment
Share on other sites

If you want to do this with skript, you can use the world change event and in that event, save the contents of the player's inventory into a list variable, clear the player's inventory, then give the player the contents of the list variable for that world. You will have to loop the player's inventory then add each item to a list. I suggest formatting the variable like {inventory::%world%::%player's uuid%::*}.

Or you could also just use a plugin called Multiverse and Multiverse Inventories to do this too.

 

Moved to Skript Discussion

Moving this to skript discussion since this looks like its asking for help relating to skript. 

  • Like 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

12 hours ago, Tarnerd said:

If you want to do this with skript, you can use the world change event and in that event, save the contents of the player's inventory into a list variable, clear the player's inventory, then give the player the contents of the list variable for that world. You will have to loop the player's inventory then add each item to a list. I suggest formatting the variable like {inventory::%world%::%player's uuid%::*}.

Or you could also just use a plugin called Multiverse and Multiverse Inventories to do this too.

 

Moved to Skript Discussion

Moving this to skript discussion since this looks like its asking for help relating to skript. 

Thank you so much! 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...