Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Will 1 datastore in another script work?

Asked by
kepiblop 124
3 years ago

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!

0
ya... but u gotta be in the same game and it has to be in a regular script anywhere. greatneil80 2647 — 3y
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'. BestCreativeBoy 1395 — 3y
0
Also, as @greatneil80 said, it should be in the same game. BestCreativeBoy 1395 — 3y
0
Wow thats pretty neat! I have a other question though, will it get the same data for a ordered data store? kepiblop 124 — 3y

2 answers

Log in to vote
0
Answered by
3F1VE 257 Moderation Voter
3 years ago

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

Ad
Log in to vote
0
Answered by 3 years ago

Yes, Datastores can be used in different scripts

Answer this question