Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Best way to store loaded data ?

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 ?

2 comments

0

It depends on the situation..

0

Its for an inventory

1 answer

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

8 comments

0
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

0

But in my case i need to save items from a inventory is your methode capable to save that ?

0

You can't save Objects. You can only save Lua valuetypes

0

"pls halp mi saev BasePart, said every noob ever."

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.

0

Il already made my savesystem and it works i just wanted to know or there is a beter way

0

Ah ok. Data compression is a biggie. Translating stuff into Hexadecimal or saving as tables is a good way about it.

This discussion is preserved as it was. New answers, comments, and votes are closed.