Give me a step by step guide of datastoreservices and how to load and save player data.
Alright! So, in a script, the first thing you do is set a variable to be your datastore.
local datastore = game:GetService("DatastoreService"):GetDatastore("plrvalues")
With a datastore, we can set any value to a key. The key must be a string.
So, for example,
datastore:SetAsync(plrdatatable, key)
plrdatatable would be a table of the data you want to save. Usually, most developers use the player’s user id as the key as it is different for each player.
And then, we can get data by providing the key:
local plrdata = datastore:GetAsync(key)
That’s really how datastore’s work. I can’t really help you any further unless I know more about what you are using it for.
Bro thanks, I was trying to figure out what getasync and setasync means!
It’s there anything else I should know about concerning this?
Not really except for a BindToClose, although I don’t have enough time to explain. Good luck with your project!
You can read about it here:
Why are you making your question look like ai prompts? What is the point when such question we’re already answered and could be accessed with a single google search.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.