Can you further clarify? The script looks fine. If you’re looking toward debugging and the Data Save progress does not complete in Studio, then you should use Game:GetService("Players").username:Kick().
Actually I tried to Debug with prints but it doesn’t go above 0 so I think it comes from the event right? It’s as if there wasn’t time to make the request.
I see the issue. You must and should use Game:GetService("Players").username:Kick() if you want to debug data save. It actually works fine when in-game, but not in Studio because IIRC no clients on it will instantly shutdown the server (Kick bypasses it I believe).
I don’t understand what you said, but you should try doing the following said. Leave removes the player, so is Kicking. PlayerRemoving is an event that is initiated by player removal (Kick and Leave).
Leaving on Roblox Studio does not help you with debugging PlayerRemoving. It actually instantly shut down the local test server. You should try kicking which bypasses that.
When you are in the game and not on Roblox Studio, it actually does save when you leave.
You have to try the method in order to know it works.
You tell me to kick, but I LEAVE the game, so explain to me where you want me to kick lol? Like I’m leaving the game I agree it comes back to kick but it doesn’t make any sense what you’re saying.