I don’t know why the error Cannot allocate attribute MeshId. Script writing access is restricted. occurs on page 10.
mesh is the head.
elseif assetTypeId == "17" then
-- head
local mesh = items:GetChildren()[1]
if not (mesh:IsA("SpecialMesh") or mesh:IsA("CylinderMesh")) then
return
end
local head = character:FindFirstChild("Head")
if head then
head.MeshId = mesh.MeshId
end
if index then
table.remove(characterAppearanceInfo.assets, index)
player:LoadCharacterAppearance(getOriginalHeadMesh())
else
for i, asset in ipairs(characterAppearanceInfo.assets) do
if productInfo.AssetTypeId == asset.assetType.id then
table.remove(characterAppearanceInfo.assets, i)
end
end
insertToTable(characterAppearanceInfo.assets, productInfo)
player:LoadCharacterAppearance(mesh)
end