Using Data Store without "leaderstats"?

Hi

  • What are you attempting to achieve? (Keep it simple and clear)
    So basically, I am wanting to have a “2 currency” game economy. TL:DR, I want to have Rubees and Coins. But I dont want the leaderboard (see picture below)
    image

But (as far as I have understood, the easiest way to use the Data Store API, is to do it via leaderstats. (Have a folder, model etc. with the currencies inside and then it will be shown in game on a leaderboard + all the other code)

  • What is the issue? (Keep it simple and clear - Include screenshots/videos/GIFs if possible)

So basically, I do not know how to use this system and not have a huge leaderboard on the screen that displays everyones money etc.

In short: Use the standard data store system but without an in-game leaderboard.

  • What solutions have you tried so far? (Have you searched for solutions through the Roblox Wiki yet?)

Searched a lot on youtube, internet, dev forum and roblox developer wiki.

You may then include any further details.

Thanks for help, and I hope you understood what I meant.

I might be totally off, but would appreciate an answer! Just ask if you dont understood something in my question!

Sincerely

3 Likes

Uhhh, no? Leaderstats has nothing to do with datastores. You could just take a leaderboard script as-is and change the name of the model/folder from “leaderstats” to anything else.

Actually, DataStores function completely independently of leaderstats. The reason you may confuse the two is simply because leaderstats is an easy way to display the information to the player, and therefore a very popular use.
Try reading up on these resources:
Data Stores | Documentation - Roblox Creator Hub - an explanation of data saving/loading
In-Experience Leaderboards | Documentation - Roblox Creator Hub - an explanation of leaderstats

8 Likes

Its really simple Instead of doing this parenting the value to a string value called “leaderstats” or stats in my example.

Just parent it to the player it self.

Didn’t know that was a thing thanks.

3 Likes

You shouldn’t give people code that you know is badly written. It takes 5 extra seconds to type out Money.Parent = Player.

Response to your edit: Parenting it immediately after creating it causes the same problem as using the parent parameter.

Hidden Stats


For creation of hidden stats, I usually use a table with values that is saved and loaded from and into a variable. The visual of the stats would look like this:

local sessionData = {
    NewFissy = {
        Rubees = 20;
        Coins = 287;
    }
}

-- started from
local sessionData = {}
2 Likes

Exploiters could still view player’s leaderstats if it’s parented to the player.

Would there be a problem if they can view it? They can’t edit it at all.

If you want a non-viewable stats that are only visible for the player, then it’s bad. I save it on a table and then use FireClient when it updates, like what Operatik said.

That’s the same thing if it is visible from a leaderstats. Players could still view it, but they’re not able to change it.

They will only be able to view it if they are exploiting it will not show up in the leader board

Before parenting it to stats aka leader board

After parenting to just the player.

Am I understanding you correctly?

I’m just saying they can only view it if they’re exploiting. However, they cannot view it if it is in a table that is fired to the client. I’m just saying it’s a better method.

Why do you mean they can’t view it? Exploiters can pick up on any data being sent from server to client, or for that matter, any data on the client. It still is better to use FireClient over creating instances under the player because you would be avoiding the price of holding the instance in memory, but its not a major difference.

I ment as in the exploiter cannot view anything sent to other players, only they can view what was sent to them