It’s pretty hard trying to force a data save when a player leaves, so you should save player data anytime you can. That’s why I recommend you to use ProfileService instead:
ProfileService:
GitHub:
https://madstudioroblox.github.io/ProfileService/
I really recommend you to use ProfileService so you don’t have any more problems with DataStore in the future, and this is not a complicated module, it’s actually a really easy module that can be learned on how to use it in max 20-30m.