- I want the script to randomly choose a color from the color table.
- The color, black, returns even though it’s not in the table.
- Used a function, tried Color3.fromRGB, etc.
local Colors = {Color3.new(255/255, 0/255, 0/255), Color3.new(255/255, 110/255, 0/255), Color3.new(255/255, 255/255, 0/255), Color3.new(0/255, 255/255, 0/255), Color3.new(0/255, 156/255, 255/255), Color3.new(200/255, 0/255, 255/255), Color3.new(255/255, 50/255, 255/255)}
local function generate()
return Colors[math.random(1, #Colors)]
end
while true do
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Part") then
local c = generate()
v.Color = c
print(c)
v.Transparency = 0
v.Material = "Neon"
end
end
wait(1)
end
Please help, thanks!