I have a custom invetory system that i can access the player hotbar with a local script
I want to save the order but when a player leaves i cant fire a remote event into the server
do you have other solutions to this problems?
since when the player leaves remote events doesnt work
and i can only access it through local scripts
The inventory data is on the client? That’s bad, that’s how you get people exploiting to get more items.
You should manage things like that on the server and just send a copy to the client when they ask for it.
Only the order of items in the hotbar is client
All I could say is that before the player leaves, you can have a button to save the order of the hotbar which will fire a remote function and save it. Have you tested it yet with the local script firing the remote function when they leave?
Yes I tested it but im searching for something more automatic
The thing is you can’t pause the Roblox leaving system for a moment so the localscript is able to fire the remote function. You should leave it Manual for the moment, I will try to think of something.
Maybe try creating folders with the name of the player in server storage or somewhere. When the player leave it will get the player’s name and find it in the storage where you placed it. And in the folder will be the order of values and then it will save it for next time when the player joins, the local script will take in what’s inside the folder. Every time the order changes, the values changes