My Datastore has an error and won't save. Help and why?

You can write your topic however you want, but you need to answer these questions:
I am trying to make a datastore save, but it won’t work. It’s supposed to save your solarpower but it won’t save it all though it still can open and start the datastore.

Here is a picture

I have tried editing the script but still won’t work and I’ve also checked th dev hub, but havent found much. If you can help would really make my day cause I kinda have a my own deadline to finish it by the end of today.

Maybe add a Player.PlayerRemoving function to make up for players who leave between the 60 seconds interval.

Well, right now I’m trying to fix the error on the DataStoreService.

Also yeah, I’ll do that thanks.

Is it printing any errors in your console? Also, are you only getting these errors in studio?

Edit: You need to enable Datastore access when testing in studio for data to save/be retrieved while testing in studio.

Uh not sure if it’s in the console for now, but yes I am getting them in studio.

Do you have Enable Studio Access to API Services enabled?

I’m not the owner of the game. I’m just doing what I can to help my friend who is the builder.

I believe you can view if it is enabled, but if you go to Game Settings then the Options (or security) Section, you will see Enable Studio Access to API Services. This needs to be enabled for the Datastore service to be accessed in studio.

You don’t have DataStoreService defined. Define it like so:

local DataStoreService = game:GetService("DataStoreService")

Edit: Don’t forget to save the player’s data when they leave the game too. You can read all about this here.

3 Likes

It’s in console too. iiiiii just for the thing

Thanks so much, now it works!!! :))

Also thanks for helping me too! :DD

1 Like