Data Not Saving my Data


Hello everyone; I have tried OVER and OVER again with data stores, looking at various tutorials, ensuring API services are enable

Yet they NEVER save my data- despite the print statement “data was saved successfully”

Anyone help, because I’m getting very frustrated

Screenshots provided

Thank you

1 Like

Could you try printing the error for better clarification of what going wrong? (which in your script is represented as a variable “err” )

Adjust your pcall “callback” function like so:

if success then 
print("Save Success") print(Datastore:GetAsync(player.UserId)) -- Print that the save was successful and also print the table saved.
elseif not success then
warn("An Error occurred saving DataStore:")
print(err)  -- Print that the save was unsuccessful and also print the error caused from saving the data.

Let me know if this helps :slight_smile:

Also, something that seems to slip my mind just about every time. You have to set the script “RunContext” or something like that in properties to run on the Server side not legacy or client(local). That should allow you to actually save to the server.

Have you made sure that it loaded data by printing it? If not then I suggest placing PlayerAdded before the SaveData function

i prefer you to use profileservice to prevent any kind of error . ITS VERY EASY TO USE once you understand . and u
Profile-Service-Guide.rbxl (67.4 KB)
dont have to care bout error anymore ( if you follow step by step )