How to get (color3) data from Datastore Table

Data does save but the value don’t get changed to the data from dstore when i enter game.


Screenshot 2022-09-09 175515

Why Just dost not save Color3 In a table and then put it on datastore?

If it’s in a table you can do it like this:

local DataStore = game:GetService("DataStoreService"):GetDataStore("ExampleName")
local Data = DataStore:GetAsync("Colors") --// Or DataStore:GetAsync(Player.UserId) if saved to player

Object.BackgroundColor = Color3.new(Data[1], Data[2], Data[3])
2 Likes

Because datastores can only store primitive value types (‘Color3’ values aren’t supported). You need to serialize the ‘Color3’ value into its components (number values) first and store those instead.
ds:SetAsync(key, {Color.R, Color.G, Color.B})

1 Like

I found a own way but thanks you anyway, i appriciate it!