local ColorFloor = game.Workspace.ColorFloor:WaitForChild("ColorPlate")
local ColorFloorChildren = ColorFloor:GetChildren()
local function ColorChange()
print("ColorChange() ran")
for i, v in ipairs(ColorFloor:GetChildren()) do
print("For loop ran")
local randomnumber = math.random(1,1)
print(randomnumber)
if randomnumber == 1 then
v.Color = Color3.FromRGB(0, 0, 0)
elseif randomnumber == 2 then
v.Color = Color3.FromRGB(255, 255, 255)
elseif randomnumber == 3 then
v.Color = Color3.FromRGB(255, 0, 0)
elseif randomnumber == 4 then
v.Color = Color3.FromRGB(0, 255, 0)
elseif randomnumber == 5 then
v.Color = Color3.FromRGB(0, 0, 255)
end
end
end
ColorChange()
- Maybe the code itself is what is breaking it. But, I'm pretty sure it is some type of logistics that I'm doing wrong. But, regardless my function will run just fine. My first print will print to the console. But, for some reason the for loop doesn't want to run. Hoping someone can see an issue with the code.
1 comment
I see its a disco floor type of code They would all just be 1 cause the minimum is 1 and the maximum is 1 so it would all just be completely black, try setting it to (1,5)