Want to stay connected to the Scripting Helpers community and get real-time help? Join the Scripting Helpers Discord Server!
Ad
Log in to vote
0

Can sombody help with my smooth gradient script?

Asked by 3 months ago

Hello i'm trying to make a rainbow brick. I used some of this code to change three values. It keeps saying "attempt to index upvalue 'raincolorr' (a number value)" on line 10 and on line 32. Right now im just trying to get it to fade to yellow. It currently stays at the color black. All ideas would be helpful. Thanks.

local raincolorr = Instance.new("IntValue")
local raincolorg = Instance.new("IntValue")
local raincolorb = Instance.new("IntValue")

coroutine.resume(coroutine.create(function()
while wait() do

if target == 1 then
while wait() do
local raincolor = Color3.fromRGB(raincolorr.Value, raincolorg.Value, raincolorb.Value)
if raincolor == Color3.fromRGB(255,255,0) then
break
else
if raincolorr.Value ~= 255 then
raincolorr = raincolorr.Value + 0.1
end
if raincolorg.Value ~= 255 then
raincolorr.Value = raincolorr.Value + 0.1
end


end
end
end



end
end))

while wait() do
workspace.Baseplate.Color = Color3.fromRGB(raincolorr.Value, raincolorg.Value, raincolorb.Value)
end

Answer this question