Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

part not changing to intended color? [FIXED]

Asked by 3 years ago
Edited 3 years ago

i made a script that's supposed to change a part's color but when i test it out, the part turns black instead of the intended color?
script:

local hexagon = game.Workspace.Hexagons
local ColorTable = {
    Color3.new("0,0,0"),
    Color3.new("255, 0, 0"),
    Color3.new("213, 115, 61"),
    Color3.new("255, 255, 0"),
    Color3.new("31, 128, 29"),
    Color3.new("33, 84, 185"),
    Color3.new("89, 34, 89"),
    Color3.new("255,255,255")
}

for keyvalue, hexagons in pairs(hexagon:GetChildren()) do
        local randomNumber = math.random(1,#ColorTable)
        local randomColor = ColorTable[randomNumber]

        hexagons.Color = randomColor
        hexagons.ColorValue.Value = randomColor

end

1 answer

Log in to vote
0
Answered by 3 years ago

i fixed it

Ad

Answer this question