What is the best way to store player data?

I’m not asking how to save data; I’m talking about the data stored in the current session.

I normally use StringValues, IntValues, NumberValues, etc., but my code looks ugly when it’s spammed with .Value, and I’m wondering if there is a better way or if I’m doing it wrong.

Not unless there is a way to reference properties without grabbing their value, you cant. But if you really wanted to get rid of all the .Values, you could always use a function

local function SetValue (TypeValue, Value)
	TypeValue.Value = Value
end

local StringValue = game.Workspace.StringValue
SetValue(StringValue, "I made an example to be more clear")

Try one of these: ProfileService, DataManager

I’ve decided to have a module that holds all the data in dictionaries since it has less memory overhead, more security, better clarity and it just looks better overall

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.