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

Does Data store compile every places in a game?

Asked by 6 years ago

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?

0
Yes it does share the same Datastore Simnico99 206 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

Ad

Answer this question