I basically am trying to get all the players HumanoidDescription accessories and turn them into Values (so I can then store and change them using DataStore2)
Problem is they are strings, not tables
Basically, if the players roleplay name is nothing (meaning they don’t have a previous data save) I have to set up their data values using their default Roblox character. It’s easy with shirts, pants, and faces, as they can only have 1 on (so simply setting the value of each data point to their HumanoidDescription counter part is easy) However, accessories are much harder
-- Loading character
if PlayerData.Character['Roleplay Name'].Value == '' then
-- No previous data
PlayerData.Character['Roleplay Name'].Value = player.Name
PlayerData.Character.Face.Value = humanoidDescription.Face
PlayerData.Character.Shirt.Value = humanoidDescription.Shirt
PlayerData.Character.Pants.Value = humanoidDescription.Pants
-- Set default accessories
for _, v in pairs(humanoidDescription.HatAccessory) do
print(v)
-- Create a StringValue (Name == Accessory name, Value == Accessory ID)
end
end
Obviously it errors on the for loop as HatAccessory is a string, and not a table, however I don’t know how else I could accomplish this
And since the accessories are folders inside the player (not values like Shirt, Face, Pants) means I have to create new values for each item.