This mannequin in my game can change colors, when a player clicks on its arm for example, the player’s arm should change to the color of the arm they clicked. However, nothing happens, no errors either. All the players have Body Colors as they use the same StarterCharacter.
Here’s the code for the mannequin’s head:
local cd = script.Parent.ClickDetector
local color = script.Parent.Color
cd.MouseClick:Connect(function(plr)
local chr = plr.Character
local bodyCols = chr:FindFirstChildOfClass("BodyColors")
bodyCols.HeadColor3 = Color3.new(color.R, color.G, color.B)
end)
Hi, I tested the script and it doesnt work with Color3.new but when i changed it to Color3.fromRGB, it worked (assuming its Color3Value) Hope this helps!
local cd = script.Parent.ClickDetector
local color = script.Parent.Color
cd.MouseClick:Connect(function(plr)
local chr = plr.Character
local bodyCols = chr:FindFirstChildOfClass("BodyColors")
bodyCols.HeadColor3 = Color3.fromRGB(color.R,color.G,color.B)
end)
We’ve gotten closer to fixing this, because now, it makes my body parts change color. But the color is always black, for some reason, not the color of the mannequin. I even tried multiplying the R and G and B by 255 but that didn’t work.
It seems to work perfectly fine for me, are you sure your RGB values are correct? 0-255 in each. What is script.Parent.Color?
here’s what i used:
local cd = workspace:WaitForChild("BodyColorPart").ClickDetector
--local color = script.Parent.Color
cd.MouseClick:Connect(function(plr)
local chr = plr.Character
local bodyCols = chr:FindFirstChildOfClass("BodyColors")
bodyCols.HeadColor3 = Color3.fromRGB(255,0,0)
end)
Not sure why it’s working fine for you guys, but I’ve found a clever workaround that did the job just fine.
local cd = script.Parent.ClickDetector
local colors = script.Parent.Parent.Colors -- this is the head of a mannequin, Colors is the name of a Body Colors instance
cd.MouseClick:Connect(function(plr)
local chr = plr.Character
local bodyCols = chr:FindFirstChildOfClass("BodyColors")
bodyCols.HeadColor3 = colors.HeadColor3
end)