local ColorTable = { Color3.fromRGB(196, 40, 28),--Red Color3.fromRGB(0, 16, 176),--Dark Blue Color3.fromRGB(40, 127, 71),--Dark Green Color3.fromRGB(255, 102, 204),--Pink Color3.fromRGB(218, 133, 65),--Orange Color3.fromRGB(245, 205, 48),--Yellow Color3.fromRGB(27, 42, 53),--Black Color3.fromRGB(242, 243, 243), --White Color3.fromRGB(140, 91, 159),--Purple Color3.fromRGB(124, 92, 70),--Brown Color3.fromRGB(18, 238, 212),--Teal Color3.fromRGB(0, 255, 0),--Lime } game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) local Parts = char:GetChildren() local RandomColor = ColorTable[math.random(1,#ColorTable)] for i = 1,#Parts do if Parts[i].ClassName == "MeshPart" or Parts[i].ClassName == "Part" or Parts[i].ClassName == "Union" then Parts[i].Color = RandomColor end end end) end)
Actually it's:
Parts[i].ClassName == "UnionOperation"
for some reason. Also yes, you need to tick UsePartColor
. Just to let you know, if your unions are multi-coloured, it will mess them up.
On the union, tick the use part color option. See if that works.
I'm guessing you're trying to randomly change the color of the unions? If there's no errors and it's not changing color this is probably because unions colors can't be changed unless you tick off a specific property in the union. To do this, go into the properties of the unions and tick off usepartcolor (I believe that's the one) and it should work.