Hello, the lost people,
I am trying to make a game inspired by Among Us. I tried to make an auto body part color giver but it seems like something is wrong. It only gives me LeftUpperArm color
I wish I can fix this ASAP. Hope you can help
Code
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local setupCharacterModule = {}
function setupCharacterModule.removeClothe(target)
target:WaitForChild("Shirt")
target:WaitForChild("Pants")
local getChild = target:GetChildren()
for index, clothing in pairs(getChild) do
if clothing:IsA("Shirt") then
clothing:Destroy()
end
if clothing:IsA("Pants") then
clothing:Destroy()
end
if clothing.Name == "Head" then
clothing.face:Destroy()
end
end
end
function setupCharacterModule.changeColor(target, color)
local getChild = target:GetChildren()
for index, bodyPart in pairs(getChild) do
if bodyPart:IsA("MeshPart") then
bodyPart.BrickColor = color
end
if bodyPart.Name == "Head" then
bodyPart.BrickColor = color
end
end
end
return setupCharacterModule