What would put for a for i loop if I want the brick color to transition from "Dark blue" to "Gold" and vice versa?
local Parenter = script.Parent local intValue = Parenter.Parent.ZValue intValue.Changed:connect(function() if intValue.Value == 1 then Parenter.BrickColor = BrickColor.new("Gold") intValue.Changed:connect(function() if intValue.Value == 0 then Parenter.BrickColor = BrickColor.new(0,0,139) end end) end end)
After looking around the web and testing in Roblox Studio, i have come up with this:
wait(3) local color = { ["11"]={["R"]=191/255,["G"]=133/255,["B"]=0/255}, --gold(Atleast... it should be?) ["10"]={["R"]=171/255,["G"]=126/255,["B"]=22/255}, ["9"]={["R"]=152/255,["G"]=120/255,["B"]=45/255}, ["8"]={["R"]=133/255,["G"]=113/255,["B"]=68/255}, ["7"]={["R"]=114/255,["G"]=107/255,["B"]=91/255}, ["6"]={["R"]=95/255,["G"]=101/255,["B"]=114/255}, ["5"]={["R"]=76/255,["G"]=94/255,["B"]=137/255}, ["4"]={["R"]=57/255,["G"]=88/255,["B"]=160/255}, ["3"]={["R"]=38/255,["G"]=81/255,["B"]=183/255}, ["2"]={["R"]=19/255,["G"]=75/255,["B"]=206/255}, ["1"]={["R"]=0/255,["G"]=69/255,["B"]=229/255} -- blue } local num = 11 for i,v in pairs(color) do num = num - 1 script.Parent.BrickColor = BrickColor.new(color[tostring(num)]["R"],color[tostring(num)]["G"],color[tostring(num)]["B"]) wait(0.4) end
This changes the color of the brick the script is a child of. This goes from gold to blue but it is easily changable to go from blue to gold by changing the value of num
from 11 to 0 and then inside the For
loop to change the num = num - 1
to num = num + 1
.
EDIT: Forgot to mention an important thing; on the internets, i found and used this site to get the color RGB codes