ObjectValue which has a list value?

I use ObjectValues to tell the client information about many different things, such as player stats, game stats, etc. Where the server has write only permission and the client has read only [because write wont matter].

However I am running into an issue where I want to put a list of numbers into one value, for example, I want to tell the client different item IDs the character is wearing, unfortunately I couldn’t find any way I can properly do this, So I was wondering if anyone knows of a good way to do so.

Since all I want to store are 3 different values, I tried making it a Vector3 Value, however that didnt work out so great as based on the ID i give it, it changes it to a different one. [ex: 607702162 changes to 607702144]

1 Like

Best other way without completely changing your system would be to make a string and encode/decode.

You could do it manually, or use HttpService:JSONEncode/Decode().

local X,Y,Z = string.match(StringValue.Value,"(%d+),(%d+),(%d+)")
X,Y,Z = tonumber(X),tonumber(Y),tonumber(Z)

StringValue.Value = X..","..Y..","..Z

or

local X,Y,Z = unpack(HttpService:JSONDecode(StringValue.Value))

StringValue.Value = HttpService:JSONEncode({X,Y,Z})
7 Likes