How to tween with brick color?

this is my script but it says Unable to assign property BrickColor. BrickColor expected, got Color3 at line 11, can u please fix the script so it tweens smoothly with brick color?

wait(3)
local r = { 
	Color3.fromRGB(254, 0, 0);  
	Color3.fromRGB(255, 127, 0); 
	Color3.fromRGB(255, 221, 1); 
	Color3.fromRGB(0, 200, 0);  
	Color3.fromRGB(0, 160, 199); 
	Color3.fromRGB(0, 55, 230);  
	Color3.fromRGB(129, 16, 210)} 
local info = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
script.Parent.BrickColor = r[1] 
local i = 1
while true do
	local tween = game:GetService("TweenService"):Create(script.Parent, info, {
		BrickColor = r[i]}) 
	tween:Play()
	repeat wait() until tween.Completed
	wait(0.1)
	if i == #r then
		i = 1
	else
		i = i + 1
	end
end

Simply replace BrickColor = r[i] with Color = r[i] and it should work.

Replace BrickColor with Color over here aswell. You’re storing the Colors as a Color3 value, not as a BrickColor value.

2 Likes

done it and errors is not a datatype that can be tweened

thanks this worked perfect mate cheers

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.