Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Will 1 datastore in another script work?

Okay There is no code that I think I need to give but if there is then let me know. But let me explain a little bit more better. So basically what I am saying is Lets say that there is 1 script it has a variable like

local datastore = game:GetService("DataStoreService"):GetDataStore("Test")

Now lets say like in another script, we type the exact same line. Now what i am wondering is will they have the same data if I saved data in the other script? Let me know if you know but if you do then please tell me! Either way, thanks!

4 comments

0

ya... but u gotta be in the same game and it has to be in a regular script anywhere.

0

The variable 'datastore' will get the service 'DataStoreService' from the Roblox and get the data stored in the name 'Test' (If Test doesn't exist, it'll create a new data store). [EG: Suppose you are saving a table, for instance -> [Test = 1] ]. Then, you'll able to access, update, delete etc. from any server script, which is getting DataStore 'Test'.

0

Also, as @greatneil80 said, it should be in the same game.

0

Wow thats pretty neat! I have a other question though, will it get the same data for a ordered data store?

2 answers

if your saying that the values will be kept the answer is no because a datastore can only hold 1 value

This discussion is preserved as it was. New answers, comments, and votes are closed.