I want the player’s limbs to be colored differently and to delete non-hair accessories.
If there is a hair accessory I want to retexture it to a specific color. And lastly, no charter meshes except for the blocky girl torso.
The parts of the player don’t change color for some reason, And sometimes accessories don’t get deleted.
I have tried adding :WaitforChild() for the limbs of the player when loading and it hasn’t worked.
I also tried looking in the Developer Hub but found no help there, Or even in any other topics posted.
Here is my script. For context, it is in server script service.
local Hat = script.Eyes
local HatC = Hat:Clone()
local Replace = script["Body Colors"]
local RC = Replace:Clone()
local players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
task.wait(0.125)
local done = false
local character = player.Character or player.CharacterAdded:Wait()
player.Character:WaitForChild("Body Colors"):Destroy()
RC.Parent = player.Character
character.ChildAdded:Connect(function(part)
if done == false then
task.wait(0.2)
if part.ClassName == "Accessory" and part.AccessoryType.Value == Enum.AccessoryType.Hair.Value then
part.Handle.Mesh.TextureId = "http://www.roblox.com/asset/?id=7807641103" --Hair color change
elseif part.ClassName == "Accessory" then
part:Destroy()
elseif part.ClassName == "CharacterMesh" then
if part.MeshId == 48112070 then
else
part:Destroy()
end
end
end
end)
local parts = character:GetChildren()
for i= 1, #parts do
if parts[i].ClassName == "Accessory" and parts[i].AccessoryType.Value == Enum.AccessoryType.Hair.Value then
parts[i].Handle.Mesh.TextureId = "http://www.roblox.com/asset/?id=7807641103" --Hair color change
elseif parts[i].ClassName == "Accessory" then
parts[i]:Destroy()
elseif parts[i].ClassName == "CharacterMesh" then
if parts[i].MeshId == 48112070 then
else
parts[i]:Destroy()
end
end
end
done = true
HatC.Parent = player.Character
HatC.Handle.Transparency = 0
HatC.Handle.Anchored = false--Eyes
done = false
end)
end)