I’m working on a Classic: Rocket Arena like game, and I’m trying to change all the avatars to the original avatars. I’m trying to change the color of each body part to make it look like the original avatars.
The issue is that the head color stays white. I’ve made the code to change the face when the spawnpoint is touched. When I look inside the body model, I change the brick color with this:
head.Color = Color3.new(255,255,0)
So far, I’ve tried to change every single variable to make it work, but this is the closest I’ve gotten to making it work.
Here’s the rest of the code if you need it.
function getDecal()
decals = {}
for i,child in pairs(script.Parent:GetChildren()) do
if child.ClassName == "Decal" then
table.insert(decals, child)
end
end
if #decals ~= 0 then
return decals[math.random(1, #decals)]
end
return nil
end
function onTouch(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
local head = hit.Parent:FindFirstChild("Head")
if head ~= nil then
local face = head:FindFirstChild("face")
if face.Texture ~= getDecal().Texture then
face.Texture = getDecal().Texture
end
end
end
end
script.Parent.Touched:Connect(onTouch)