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

"Concept" - How would I go about making a leaderboard save through multiple games?

Asked by 6 years ago
Edited 6 years ago

So I have a game with multiple maps and I am not sure how to start going about making a leaderboard with stats that save through the multiple maps. (examples: Ultimate Driving, Swordburst 2, etc) What would I need to do to start out? As well as how would I make the player's tools save through multiple games?

3 answers

Log in to vote
0
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
6 years ago

DataStores and OrderedDataStores can be shared between other places in the same game universe.

If you created a DataStore, and or OrderedDataStore, you can access it in a different place in the same game universe by getting the datastore with the name that was given to it.

Say you've created an OrderdedDataStore with the name 'Ods' in the universe's start place:

local ods = game:GetService('DataStoreService'):GetOrderedDataStore('Ods')

If you wanted to access it in another place in the universe, get it by the same name:

local ourOds = game:GetService('DataStoreService'):GetOrderedDataStore('Ods')
0
How would I go about adding a place to a game universe? I remember doing it once before but I cant remember. ResoluteAyres 6 — 6y
0
Whenever I try and add a place it simply says "Cannot use start place" ResoluteAyres 6 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

In order to save data in general you would need to use the Roblox Datastores:

http://robloxdev.com/articles/Data-store

The datastores save throughout multiple Places as long as they are all in a singular Universe.

http://robloxdev.com/articles/Multi-Place-Games

Datatores can only save particular types of values inside them which include:

Numbers, Strings, Tables, Booleans, or nil

So in order to save Objects such as a tool, or a Vector such as a position. You would need to come up with a clever system using the available datatypes to store the unusable datatypes in a way that you can load them back up again and determine what they are in Object or Vector form (as an example).

Log in to vote
-1
Answered by 6 years ago

If you need the leaderboard to save through multiple instances of a server (when the player leaves and joins again later), you need to learn about datastores.

Here's a tut on how to save a currency value with a datastore (which might not be what youre looking for): http://robloxdev.com/articles/In-Game-Currency-with-Roblox

there are also videos on youtube that show you how to save leaderboard values but i wont bother linking you to those since theyre easy to find

good luck!

0
Ive looked at those and I understand some of that, but what about loading that leaderboard in another game? ResoluteAyres 6 — 6y
0
you get the value/table/whatever using datastore:GetAsync(the string you've set for the player) then store it into the value thats on the leaderboard. radusavin366 617 — 6y
0
i mean you do that when a player join using Players:OnPlayerJoin radusavin366 617 — 6y
0
you do Players:OnPlayerJoin:Connect(function() *load the data off the data store using *datastorename*:GetAsync and load it into the players leaderboard value* end radusavin366 617 — 6y

Answer this question