I made a system where it updates a certain Color3 value in a folder when a remote event is fired. When I attempt to retrieve that value that I save in a dictionary, the numbers are essentially negatively exponentially multiplied.
This is a screenshot of the code that receives the event and updates the folder accordingly (ignore the abbreviations I use for the variables). All values in the folder seem to be found, as no error is thrown when initializing the script.
When you use Color3.fromRGB() it converts into a Color3 value, which is between 0 and 1. Then when you are setting it via your loop using Color3.fromRGB, you are technically setting the “G” value to 1, which then becomes .003921 and is the wrong color.
You can multiply your R, G, B values by 255 when setting the value under your RetrievedPlayerData.Colors loop and it should be fixed, alternatively, you could just use Color3.new() and put your RGB values in there too(which is simpler than multiplying by 255 for each number).
Replace the code in your 4th image with this:
if RetrievedPlayerData.Colors then
for ColorName, ColorValue in pairs(RetrievedPlayerData.Colors) do
print(ColorName, ColorValue)
ColorPreferencesFolder[ColorName].Value = Color3.new(ColorValue["R"], ColorValue["G"], ColorValue["B"])
end
end
That’s one solution, the other is to just have them send in the RGB values and save the whole numbers if you want to make it easier to read the RGB values in the datastore.