the ploblem is i have welds on my customcharacter like shoulder pads and here u deal with it:
local remote = game.ReplicatedStorage.RemoteFunction
function remote.OnServerInvoke(player, msg)
if msg == "Change1" then
local char = workspace:FindFirstChild(player.Name)
if char ~= nil and char:FindFirstChild("Humanoid") ~= nil then
-- Remove Prior Accessories
for i, v in pairs(char:GetDescendants()) do
if v.ClassName == "Accessory" then
v:Destroy()
end
end
-- Remove Face (Not Required, Only if you have another to force the user to wear)
for i, v in pairs(char:GetDescendants()) do
if v.Name == "face" then
v:Destroy()
end
end
-- Changes Shirt, if applicable
if char:FindFirstChild("Shirt") ~= nil then
char.Shirt.ShirtTemplate = "rbxassetid://0" -- Asset Id of Shirt
end
-- Changes Pants, if applicable
if char:FindFirstChild("Pants") ~= nil then
char.Pants.PantsTemplate = "rbxassetid://0" -- Asset Id of Pants
end
-- Changes Body Colors, if applicable, not required
local color = char:FindFirstChild("Body Colors") -- Each Color Ranges from 0 to 255
if color ~= nil then
color.HeadColor3 = Color3.new(0, 0, 0)
color.LeftArmColor3 = Color3.new(0, 0, 0)
color.RightArmColor3 = Color3.new(0, 0, 0)
color.LeftLegColor3 = Color3.new(0, 0, 0)
color.RightLegColor3 = Color3.new(0, 0, 0)
color.TorsoColor3 = Color3.new(0, 0, 0)
end
-- Adds New Hair or Other Accessory
local accessory = Instance.new("Accessory")
local hair = Instance.new("Part")
local mesh = Instance.new("SpecialMesh")
local weld = Instance.new("Weld")
accessory.Name = "Hair"
accessory.Parent = char
hair.Name = "Handle"
hair.CanCollide = false
hair.Anchored = true
hair.Size = Vector3.new(1,1,1)
hair.Parent = accessory
weld.Parent = hair
weld.Part0 = hair
weld.Part1 = char.Head
weld.C0 = CFrame.new(0, 0, 0) -- Test in Studio to Determine correct offset
hair.Anchored = false
mesh.MeshId = "rbxassetid://0" -- Mesh Id
mesh.TextureId = "rbxassetid://0" -- Texture Id
mesh.Scale = Vector3.new(1, 1, 1)
mesh.Parent = hair
wait()
return true -- This is the second part of the remote function, firing to the client
end
end
end

1 comment
lol