I have an error that I have never seen in my life :0
Basically I’m trying to change the value in a Table to save it afterwards.
However, when trying to update the sub-Value in the Dictionary called bcolor, Roblox says something wrong saying that I can’t change bcolor with a string.
attempt to index string with ‘bcolor’
before trying ‘bcolor’, I tried other things like ‘color’ and ‘tipo’
and in the same way it continued to return the error.
Script:
local aparenciaTable = {
['Hair'] = {
['modelo'] = 'None',
['bcolor'] = 'Medium brown',
},
['Beard'] = {
['modelo'] = 'None',
['bcolor'] = 'Medium brown',
},
['Clothes'] = 'Peasant_1',
['SkinColor'] = 'Pastel brown',
['Race'] = 'Human',
['Outfit'] = 'None',
['Face'] = 'Default',
}
for _,v in pairs(data.Character:GetChildren()) do
if v.Name == "HairColor" then
aparenciaTable.Hair['bcolor'] = v.Value
elseif v.Name == "BeardColor" then
aparenciaTable.Beard['bcolor'] = v.Value
elseif v.Name == "Hair" then
aparenciaTable.Hair['modelo'] = v.Value
elseif v.Name == "Beard" then
aparenciaTable.Beard['modelo'] = v.Value
end
aparenciaTable[v.Name] = v.Value
end