local colortable = {
Color3.fromRGB(218, 133, 65),
Color3.fromRGB(163, 75, 75),
Color3.fromRGB(160, 132, 79),
Color3.fromRGB(106, 57, 9),
Color3.fromRGB(255, 204, 153),
Color3.fromRGB(188, 155, 93),
Color3.fromRGB(196, 40, 28)
}
for i,v in pairs(workspace:GetDescendants()) do
if v:IsA("BasePart") and v.Name == 'Leaves' then
v.Color = math.random(1, #colortable)
end
end
The title explains my error, Im trying to color some trees but its erroring
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("BasePart") and v.Name == 'Leaves' then
v.Color = Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255))
end
end
This would provide truly random colors, if that was what you were trying to achieve.