ProfileService Save Hats

Greetings, I’m trying to find a way to Code, for my Trading game that uses ProfileService, to keep hats, everytime you rejoin game. you have to manually put the Hat’s back on with a GUI, I’ve coded.

Heres an Example of the video:

If anyone knows, please Tell me How!

Well, I can’t provide any code examples (I haven’t memorized the documentation for ProfileService yet), but I can say that you should be saving a table of all the hats that are equipped (when leaving or when autosaving) and then loading them in when you join the game, and then equipping the hats in the previously stored table.

Nevermind, It’s DataStore2. My fault, I have auto correct on.

as another pointed out you would use tables to accomplish this

--combine and set up store

--then fetch (get)
EquipStore:Get({Hats={"Valkryie", "Well Worn Hat"})

--and table.insert/remove respectively

Hmm… Seems good, but How would it work?.

You can try to assign for each hat it’s own number like

[1] = {
{“Hat”}
}

U already coded a save system for the hats?

Example save:
if GameHandler.PlayersProfile[plr].Profile.Data[“PlayerData”][“Hats”][itemname] ~= nil then
table.insert(GameHandler.PlayersProfile[plr].Profile.Data[“PlayerData”][“Hats”], itemname)
end

Try that

The table needs to be created first.

Im just showing the save method

1 Like

Yes, I have. here’s some code. since it’s over 5000 Paragraphs long.

	
	["Items"] = {
		
		["Snakepack"] = {
			
			["Value"] = 1848,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 493496072,
			["Image"] = "rbxassetid://10779833656",
			["Demand"] = "N/A",
			["Trend"] = "N/A",
			
		},

		["Noob Assist: Fearless Filmer"] = {

			["Value"] = 1617,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 1469827401,
			["Image"] = "rbxassetid://10779840744",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Swordpack"] = {

			["Value"] = 1402,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 19398258,
			["Image"] = "rbxassetid://10779845120",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Noob Attack: Scythe Strike"] = {

			["Value"] = 648,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 1301384400,
			["Image"] = "rbxassetid://10779847326",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["White Ninja Headband of the Unimpeachable Soul"] = {

			["Value"] = 874,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 11297746,
			["Image"] = "rbxassetid://10779852141",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Noob Assist: Burger Boost"] = {

			["Value"] = 779,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 139617823,
			["Image"] = "rbxassetid://10779855149",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Take a Chance"] = {

			["Value"] = 1285,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 11188705,
			["Image"] = "rbxassetid://10779857667",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Elegant Fabergé Egg of Fancy Times"] = {

			["Value"] = 955,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 152980562,
			["Image"] = "rbxassetid://10779860734",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Red Baseball Cap"] = {

			["Value"] = 1097,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 1028606,
			["Image"] = "rbxassetid://10779862903",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Retro Pattern Shades"] = {

			["Value"] = 1039,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 117410734,
			["Image"] = "rbxassetid://10779864687",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Copper Hat of Cents"] = {

			["Value"] = 6142,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 128207293,
			["Image"] = "rbxassetid://10780581761",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Futuristic Egg of Antigravity"] = {

			["Value"] = 345,
			["Limited"] = false,
			["Stock"] = 1e1000,
			["Id"] = 76692077,
			["Image"] = "rbxassetid://10780697954",
			["Demand"] = "N/A",
			["Trend"] = "N/A",

		},

		["Shooting Star"] = {

try this PlayersProfile[plr].Profile.Data.PlayerData[“Items”][tostring(itemName)] = {[“Value”] = Value, [“Limited”] = isLimited, [“Stock”] = StockItem, [“Id”] = IdItem, [“Image”] = ImageItem, [“Demand”] = Demand, [“Trend”] = Trend} for insert new item into data

sometime using table.insert into playerprofile data table that make the old data table replaced with new data (its unknownable glitch)

How would this go? and or work.

that save system for ProfileService