-
I have a script that gets the player’s accessories and puts them in my startercharacter
-
The loaded accessory’s handle is a part with a special mesh. Instead, I want it to be a meshpart.
I am aware that R15 rigs have meshparts as handles, but I do not know how to change it. -
This is the script, it is placed in Server script service
local players = game:GetService("Players")
local insert = game:GetService("InsertService")
local protectedCall = pcall
local function onPlayerAdded(player)
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local success1, result1 = protectedCall(function()
local GAppear = players:GetCharacterAppearanceInfoAsync(player.UserId)
return GAppear
end)
if success1 then
if result1 then
for _, array in ipairs(result1["assets"]) do
if array["assetType"]["name"] == "Hat" or array["assetType"]["name"]:match("Accessory$") then
local success2, result2 = protectedCall(function()
return insert:LoadAsset(array["id"])
end)
if success2 then
if result2 then
local accessory = result2:FindFirstChildOfClass("Accessory")
if accessory then
humanoid:AddAccessory(accessory)
end
end
else
warn(result2)
end
end
end
end
else
warn(result1)
end
end
player.CharacterAdded:Connect(onCharacterAdded)
end
players.PlayerAdded:Connect(onPlayerAdded)
The script is fully functioning, and the starter character is placed in the starter player