How can i make a saving inventory?

In short, i have a shop that lets you buy skins for a sword (each skin is a different tool so you can see it as different tools).

I want to make it so when the player gets one of those tools from a lootbox it gets added to their inventory and saves after they leave.

I am not talking about the player’s backpack, i am talking about a custom UI inventory system.

If someone could tell me how to do it, link youtube videos or devforum posts, that would be of great help.

Thanks!

1 Like

You want to save data tables within these data tables you save pretty much anything you would like.

once you can save and retrieve your data tables you want to make modules and functions to easily edit these data tables.

local PlayerData =  {
Money = 0,
Inventory  = {
	Skins = {},
	},
}
PlayerDataModule = {}
local DataManager = require(game.ServerScriptService.DataManagers.DataManager)

function PlayerDataMoudle.AddSkin(Player,SkinID)
local PlayerData = DataManager:GetProfile(Player)--// Or how ever you will do it
local Skins = PlayerData.Inventory.Skins
table.insert(Skins,SkinID)
end

return PlayerDataModule 

This is just an example of how it would look or what you would need to understand In my example I used ProfileService

2 Likes

Put all of the player’s items in a table, then save the table with this: Saving Data | Roblox Creator Documentation

1 Like