Hi, I’m making a catalog script so basically it puts the accessories onto your character and then when the player clicks save it should loop through the character and check the accessories and save them
Im getting an error that you cant take the asset id from the accessory itself but I’ve even tried with humanoid description but that just gives me the players original avatar accessories not the one that I want which are the ones I put on the character.
I have tried every possible way but cant figure this out so any help would be appreciated.
game.ReplicatedStorage.save.OnServerEvent:Connect(function(player,profile)
local actual = profile:gsub(" ","")
if player.Character then
for _, child in ipairs(player.Character:GetChildren()) do
if child:IsA("Accessory") then
local newval = Instance.new("IntValue")
newval.Parent = player.Profiles[actual]
local Asset = game:GetService("MarketplaceService"):GetProductInfo(child.AssetId)
newval.Name = Asset.Name..":"..actual
print(child) -- Print the accessory itself
newval.Value = child.AssetId
end
end
else
warn("Character not found for player: " .. player.Name)
end
end)