Im trying to save the players skin color in DataStore but i can't get it to work because im always getting black color but my color was brown when i saved, here is what i have:
01 | local information = { |
02 | [ "SkinR" ] = char.Head.Color.R; |
03 | [ "SkinG" ] = char.Head.Color; |
04 | [ "SkinB" ] = char.Head.Color; |
05 | } |
06 |
07 |
08 | if info.SkinR then |
09 |
10 |
11 | print ( "skin color found" ) |
12 |
13 | local color 1 ,color 2 ,color 3 = info.SkinR,info.SkinG,info.SkinB |
14 | local color = Color 3. new(color 1 ,color 2 ,color 3 ) |
15 | print (info.SkinR) |
You are doing
1 | local information = { |
2 | [ "SkinR" ] = char.Head.Color.R; |
3 | [ "SkinG" ] = char.Head.Color; |
4 | [ "SkinB" ] = char.Head.Color; |
5 | } |
You are forgetting to index both G and B to get their colours, which means that you are attempting to instantiate a Color3 with (float, color3, color3) when in reality it takes (float, float, float), to fix this simply change it to
1 | local information = { |
2 | [ "SkinR" ] = char.Head.Color.R; |
3 | [ "SkinG" ] = char.Head.Color.G; |
4 | [ "SkinB" ] = char.Head.Color.B; |
5 | } |
And it should work