DataStore2: How to access the datastore in other scripts

Also, does PlayerAdded event works for each player separately?
And how would I change value manually? Basically, in Explorer or in-game with admin.

What do you mean?

You have to require the DataStore2 module in the command line (be it in Studio’s or the in-game one) and you could increment it there, but I’m not sure.

I mean, each PlayerAdded event is like spawn() event?

It should fire for every player that joins, unless it has a bunch of code that yields before it gets to the connecting part.

Yeah xD, but it has core and runs for each player separately during whole game?

I just realized I lost some piece of data :confused:
I don’t know why. Maybe beacuse I’m testing in Studio?
Wait, it doesn’t save anymore…

EDIT: Seems to be fine in game I guess.

Do you know how would I make save all data (like autosave)?
Would this be ok:

while true do
      DataStore2:SaveAll(player)
      wait(120)
end

What about something less than 120, like 30 (I heard anything below 100 seconds isn’t good…)

You do not need to do that. Just trust DataStore2 completely. It will do its job.