Hello...I'm trying to select a random color value from a table but it returns with Workspace.Scripts.randomNPC:14: invalid argument #2 to 'random' (interval is empty)
Here is a snippet of my script:
local Colors = {
Color1 = Color3.fromRGB(255,229,180),
Color2 = Color3.fromRGB(222,184,135),
Color3 = Color3.fromRGB(139,69,19)
}
local randomColor = Colors[math.random(1,#Colors)]
for _,limb in pairs(npc:GetChildren()) do
if limb:IsA("BasePart") then limb.Color = randomColor end
end
help?

2 comments
Try just calling random with one value, "math.random(#Colors)" as it automatially assumes you want a range between 1 and #Colors
Maybe instead of using Color3, use BrickColor.random()