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

Best way to store loaded data ?

Asked by 6 years ago

Currently i make for every joined player a folder in server storage and load my data inside string values and int values but is this a good way to do it or is there a better one ?

0
It depends on the situation.. User#20388 0 — 6y
0
Its for an inventory yentedolfijn 0 — 6y

1 answer

Log in to vote
0
Answered by
Pejorem 164
6 years ago

I just have a Data ModuleScript that handles everything internally. There's settings for each thingy so that leaderstats can be made to display certain bits of data... but everything for me is stored in a table in the script. And then to retrieve or modify information, BindableEvents/Functions would be used to communicate with it. (I never have a RemoteEvent/Function directly sourced to it). This way changes can be queued and saved effectively (i.e removing items from the saveQueue list that are in the queue again later but with a different value).

local dataSettings = {
    {
        Name = "Coins",
        LeaderstatType = "IntValue", --optional
        PlayerPointsCoefficient = 40, --optional & "pointsToAward = value * PlayerPointsCoefficient
        IsOrderedData = true --whether to use normal DataStore
    }
}

And I just run through this table creating stats n' stuff when a player joins.

local playerData = {}

newPlayer = function(plr)
    playerData[plr.UserId] = IndvidualPlayersData
end
0
https://www.roblox.com/library/989287701/Data-Handling-V4-0 Incomplete tbh but I still use it lel Pejorem 164 — 6y
0
And when the server starts my module just creates a table of all the actual datastores...... rather than retrieving them every time a player joins which would be BAD Pejorem 164 — 6y
0
But in my case i need to save items from a inventory is your methode capable to save that ? yentedolfijn 0 — 6y
0
You can't save Objects. You can only save Lua valuetypes Pejorem 164 — 6y
View all comments (4 more)
0
"pls halp mi saev BasePart, said every noob ever." Pejorem 164 — 6y
0
By the sounds if it you're probably not ready for the "Best way" to save data but neither am I probs....... Best to find something that works for you. Which is most likely described in the roblox wiki for you. Pejorem 164 — 6y
0
Il already made my savesystem and it works i just wanted to know or there is a beter way yentedolfijn 0 — 6y
0
Ah ok. Data compression is a biggie. Translating stuff into Hexadecimal or saving as tables is a good way about it. Pejorem 164 — 6y
Ad

Answer this question