Datasave Ui help

I’ve made a gui where if you buy the ui in the game you get another ui to pop up but the new gui has a button where it gives you a hat. I want to know how do i make the ui save if the player leaves and rejoin and the same for the hat? Its kinda like an avatar shop

I’m kind of confused, Could you elaborate?

so i have a gui where you click a button that cost money in the game and when you purchase that another gui pops up and if you click that ui it gives you a hat im trying to know how to save the gui and hat.
its like a shop and inventory 1st gui is the shop and the other is the inventory and when you click the ui inside the inventory you get the hat.

How I would do it is I would name all of the UI differently, if the user has data saved in the datastore then you would just show that UI rather then the default normal one but if they don’t have any saved then you would just show the normal UI if that makes sense. I would recommend saving the UI name to the datastore so you can show it however you could also do something instead where you just save it as a number and that number correlates to a UI.

1 Like

What do you mean save the UI? You mean save it within the data save?

yes like a ui that will never be invisible again

Datastores allow UTF-8 characters to be saved. You can save the name of each accessories and when you load it you attempt to find it in the accessory storage you have. Then load it into the players!