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

Does Data store compile every places in a game?

Example: Here's a game called "The Legit RPG" It has 3 places called "Lobby", "Main World" and "Boss Fights"

The lobby has shops that sell swords for the player. When the new player is joined, he has a wooden sword and no money, so he went to a portal and teleported to the "Main World" aka another place in the game.

He fought some mobs and earn cash. He has 100 gold (Data store has saved the amount of gold that he currently has.) and now he wants buy a stronger sword. But he wonder if he teleport back to the lobby. Does his gold be saved when the data store load in the Lobby?

1 comment

0

Yes it does share the same Datastore

1 answer

✓ Accepted answer

Yes, it does but you need in separate scripts in the game the exact same DataStore Name

Example:

The Legit RPG Workspace script

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

Main world and boss fight script in workspace

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

In every one of your places data store script, where it says :GetDataStore(), you have to put in a certain name in that for all the places and it will immediately get the data!

Have fun

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