Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can is save skin color with Datastore?

Asked by 4 years ago

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:

01local information = {
02            ["SkinR"] = char.Head.Color.R;
03            ["SkinG"] = char.Head.Color;   
04            ["SkinB"] = char.Head.Color;
05        }
06 
07 
08if info.SkinR then 
09 
10 
11print("skin color found")  
12 
13local color1,color2,color3 = info.SkinR,info.SkinG,info.SkinB
14local color = Color3.new(color1,color2,color3)
15                print(info.SkinR)
View all 47 lines...
1
use character:GetChildren() and an in pairs loop next time. And at least attempt to do some datastore stuff before asking a question. Dovydas1118 1495 — 4y
0
thats not helping me valledestroy 54 — 4y
0
Would a color3 variable help? data storing that might work :) archerdancom -3 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You are doing

1local 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

1local information = {
2            ["SkinR"] = char.Head.Color.R;
3            ["SkinG"] = char.Head.Color.G;   
4            ["SkinB"] = char.Head.Color.B;
5        }

And it should work

Ad

Answer this question