Save the players data using Datastore service. There are modules that make it very easy to implement a secure and reliable datastore system (such as Datastore2 and ProfileService). I recommend ProfileService as it has session locking.
As for how you would save the order. Just have a dictionary of the players currently equipped items and their designated slot.
As far as I know there is no hard way to say “tool 1 goes in slot 1” and so on. However what you could do is simply loop through the list of items using a for loop → Make sure the list is in order (or that you’re looping in order) and parent them one by one to the toolbar.
Roblox by default should equip the first tool parented to the first slot, second tool parented to the second slot, and so on.
Imagine you have 2 tools, Handgun and Classic Sword, if you set the parent of Handgun to Player.Backpack after Classic Sword, Handgun will appear in the first slot (if you don’t have tools yet) and Classic Sword in the second slot, but to save the tools order idk lol, maybe learning som about CoreGui will be useful for you.
Oh yeah I didn’t realize that theres no way to actually determine what is in what slot after a player arranges their inventory. I may have to resort to a custom inventory system.
Studio Settings → Studio → Show Hidden Objects On Explorer = on, with that you will be able to see “CoreGui”, which works like All client’s PlayerGui if i’m not wrong.
update on this solution, it actually does not work.
Core Gui cannot be tampered with you cannot even check the toolname for some reason even if your not actually changing anything which is pretty stupid. I am still actively looking for a solution to get the hotbar order of a player.
I’ve been using this. I should probably mark it as a solution as I imagine this problem is frequented.
This is basically a copy of the backpack system without making it apart of the core gui. The functionality and appearance are the exact same but the difference is you can edit the code and actually read the hotbar and inventory data.
This has been a solid workaround for me over the years. Hopefully they actually let us read it though one day lol.
I shouldn’t have to fork the backpack system just to have saving hotbars.
I made my own backpack system which acts just like the roblox one and saves all tools but I would still rather use the default backpack so that new users are accustomed to it.