You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
Im trying to save a few Color3 values within a data store (currently all I have are NumberValues).
- What is the issue?
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("AvatarData")
local RunService = game:GetService("RunService")
local Data = {
Face = 26424808;
Shirt = 3750508496;
Pants = 3;
Hat = 151784320;
Head = 256, 256, 256
}
local playersavetable = {};
local function loadStarterData(Player)
local CharData = Instance.new("Folder")
CharData.Name = "AvatarConf"
CharData.Parent = Player
for statname, statvalue in pairs(Data) do
if type(statvalue) == 'number' then
local intvalue = Instance.new("IntValue")
intvalue.Name = statname
intvalue.Value = statvalue
intvalue.Parent = CharData
end
end
end
Here is the code, I’ll explain the issue in question 3
- What solutions have you tried so far?
Well first I tried adding a
elseif type(statvalue) == 'Color3' then
local color3 = Instance.new("Color3Value")
but despite “Color3Value” existing, it seems that ‘color3’ is not a type of statvalue.
Then I tried looking up some articles/documentation such as
https://developer.roblox.com/en-us/api-reference/lua-docs/Roblox-Globals
https://developer.roblox.com/en-us/api-reference/lua-docs/Lua-Globals
and I found this
Returns the type of its only argument, coded as a string. The possible results of this function are “nil” (a string, not the value nil), “number”, “string”, “boolean”, “table”, “function”, “thread”, and “userdata”.
so Color3 is not listed in the functions so does that mean I can’t save the body colors for legs, head, etc?
If I missed anything or if anyone has any questions then please let me know