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)
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!
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
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 = {}
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.
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.