Why does this code not change the color of my part?

for i = 1, #chatsMAD do
			task.wait(1.5)
			local R = 175
			local G = 148
			local B = 131
			R += 30
			Guy.Color = Color3.fromRGB(R, G, B)
			ChatService:Chat(Guy, chatsMAD[i], Enum.ChatColor.Green)
		end

idk why it wotn work, ive never tried to change color values individually

1 Like

Can you show more of your code? What exactly are you trying to achieve?

This won’t run if #chatsMAD is <= 0, that could be why.

Looks like tweening.

Guy.Color = Color3.fromRGB(0, 148, 131)
game:GetService("TweenService"):Create(Guy, TweenInfo.new(4.5, Enum.EasingStyle.Exponential), {Color = Color3.fromRGB(255, 148, 131)}):Play()

chatsMAD basically is a table with text, see the code runs fine,no errors. but the part does not change color

You set R to a variable, 175. Every iteration, you’re always setting Color3.fromRGB(205, 148, 131).

all the values matter, i need red to start at the value its at, becuase the colors are for a characters head. so its gotta be the skintone, then it gets more red because hes mad

1 Like

Take the already set R value.


for i = 1, #chatsMAD do
	task.wait(1.5)
	Guy.Color = Color3.fromRGB(math.clamp(Guy.Color.R + 30, 0, 255), 148, 131)
	ChatService:Chat(Guy, chatsMAD[i], Enum.ChatColor.Green)
end
1 Like

that meaks his head cyan then does nothing else, it should slowly make his head more and more red each time the iv loop runs

1 Like

I fixed it by doin some other stuffs, thabnks for ur help

1 Like

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