Couple things unrelated:
You should only save data every 60 seconds or so and upon the player leaving.
You get the datastore 2 times when you could just get it once.
Always use userid for datastores.
Is the function for setAsync actually running?
It’ll only save whenever PersonalBest changes from it’s value. Also save data via the user id, not the name since if the player changes their name, you’ll end up loading up a new data for them.
I figured to use UserId rather than the player names. I have so when the player reaches the end of the level it changes the value of PersonalBest. It just won’t save to the datastore.
Thanks for the help btw
I just noticed that you used .Changed. The variable passed to the connected function is the name of the property changed, not the value.
edit: nvm, that doesn’t apply to values