Color picker not working

Hi!
Here is my Color Picker. It should pick a color, change it, and then turn CC off. It instead crashes.


4COLOR:

local blue = script.Parent.Blue
local red = script.Parent.Red
local green = script.Parent.Green
local yellow = script.Parent.Yellow
local chosen = 0
chosen = (math.random(1,4)) 
-------code
while wait() do

	if chosen == 1 then
		blue.Color = {115, 114, 116}
		wait (0.5)
		blue.CanCollide = false
		wait (5)
		blue.CanCollide = true
		blue.Color = {13, 105, 172}
		chosen = (math.random(1,4)) 	
	elseif chosen == 2 then
		green.Color = {115, 114, 116}
		wait (0.5)
		green.CanCollide = false
		wait (5)
		green.CanCollide = true
		green.Color = {0, 255, 0}
		chosen = (math.random(1,4)) 
	elseif chosen == 3 then
		red.Color = {115, 114, 116}
		red.CanCollide = false
		wait (5)
		red.CanCollide = true
		red.Color = {196, 40, 28}
		chosen = (math.random(1,4)) 
	elseif chosen == 4 then
		yellow.Color = {115, 114, 116}	
		yellow.CanCollide = false
		wait (5)
		yellow.CanCollide = true
		yellow.Color = {255, 255, 0}	
		chosen = (math.random(1,4)) 
	end
	
end

6COLOR: (BUG FIRST POPPED UP HERE)

local blue = script.Parent.Blue
local red = script.Parent.Red
local green = script.Parent.Green
local yellow = script.Parent.Yellow
local magenta = script.Parent.Magenta
local orange = script.Parent.Orange
local chosen = 0
chosen = (math.random(1,6)) 
-------code
while wait() do

	if chosen == 1 then
		blue.Color = {115, 114, 116}
		wait (0.5)
		blue.CanCollide = false
		wait (5)
		blue.CanCollide = true
		blue.Color = {13, 105, 172}
		chosen = (math.random(1,6)) 	
	elseif chosen == 2 then
		green.Color = {115, 114, 116}
		wait (0.5)
		green.CanCollide = false
		wait (5)
		green.CanCollide = true
		green.Color = {0, 255, 0}
		chosen = (math.random(1,6)) 
	elseif chosen == 3 then
		red.Color = {115, 114, 116}
		red.CanCollide = false
		wait (5)
		red.CanCollide = true
		red.Color = {196, 40, 28}
		chosen = (math.random(1,4)) 
	elseif chosen == 4 then
		yellow.Color = {115, 114, 116}	
		yellow.CanCollide = false
		wait (5)
		yellow.CanCollide = true
		yellow.Color = {255, 255, 0}	
		chosen = (math.random(1,6)) 
	elseif chosen == 5 then
		orange.Color = {115, 114, 116}	
		orange.CanCollide = false
		wait (5)
		orange.CanCollide = true
		orange.Color = {213, 115, 61}	
		chosen = (math.random(1,6)) 
	elseif chosen == 6 then
		magenta.Color = {115, 114, 116}	
		magenta.CanCollide = false
		wait (5)
		magenta.CanCollide = true
		magenta.Color = {170, 0, 170}	
		chosen = (math.random(1,6)) 
	end
	
end

image
nO, CHANGING TO cOLOR3 DID NOT WORK.

? It should be looking in the part, finding the “Color” value and changing it to 115, 114, 116

Are you sure you’re instancing a new Color3 correctly? This how you should be setting your colors:

green.Color = Color3.fromRGB(115,114,116)

trying it now. it take forever to change the values


no good.

local blue = script.Parent.Blue
local red = script.Parent.Red
local green = script.Parent.Green
local yellow = script.Parent.Yellow
local chosen = 0
chosen = (math.random(1,4)) 
-------code
while wait() do

	if chosen == 1 then
		blue.color = Color3.fromRGB(115, 114, 116)
		wait (0.5)
		blue.CanCollide = false
		wait (5)
		blue.CanCollide = true
		blue.color = Color3.fromRGB(13, 105, 172)
		chosen = (math.random(1,4)) 	
	elseif chosen == 2 then
		green.color = Color3.fromRGB(115, 114, 116)
		wait (0.5)
		green.CanCollide = false
		wait (5)
		green.CanCollide = true
		green.color = Color3.fromRGB(0, 255, 0)
		chosen = (math.random(1,4)) 
	elseif chosen == 3 then
		red.color = Color3.fromRGB(115, 114, 116)
		red.CanCollide = false
		wait (5)
		red.CanCollide = true
		red.color = Color3.fromRGB(196, 40, 28)
		chosen = (math.random(1,4)) 
	elseif chosen == 4 then
		yellow.color = Color3.fromRGB(115, 114, 116)	
		yellow.CanCollide = false
		wait (5)
		yellow.CanCollide = true
		yellow.color = Color3.fromRGB(255, 255, 0)	
		chosen = (math.random(1,4)) 
	end
	
end

You need to capitalize “Color”:

local blue = script.Parent.Blue
local red = script.Parent.Red
local green = script.Parent.Green
local yellow = script.Parent.Yellow
local chosen = 0
chosen = (math.random(1,4)) 
-------code
while wait() do

	if chosen == 1 then
		blue.Color = Color3.fromRGB(115, 114, 116)
		wait (0.5)
		blue.CanCollide = false
		wait (5)
		blue.CanCollide = true
		blue.Color = Color3.fromRGB(13, 105, 172)
		chosen = (math.random(1,4)) 	
	elseif chosen == 2 then
		green.Color = Color3.fromRGB(115, 114, 116)
		wait (0.5)
		green.CanCollide = false
		wait (5)
		green.CanCollide = true
		green.Color = Color3.fromRGB(0, 255, 0)
		chosen = (math.random(1,4)) 
	elseif chosen == 3 then
		red.Color = Color3.fromRGB(115, 114, 116)
		red.CanCollide = false
		wait (5)
		red.CanCollide = true
		red.Color = Color3.fromRGB(196, 40, 28)
		chosen = (math.random(1,4)) 
	elseif chosen == 4 then
		yellow.Color = Color3.fromRGB(115, 114, 116)	
		yellow.CanCollide = false
		wait (5)
		yellow.CanCollide = true
		yellow.Color = Color3.fromRGB(255, 255, 0)	
		chosen = (math.random(1,4)) 
	end

end