TweenService:Create problem

Hello everyone, i encountered a problem with tween service. When im using TweenService:Create, im trying to change properties TextColor3 and BackgroundColor3 of TextBox, but for a reason I don’t understand, script changes only TextColor3. Here’s a part of my code:

if layer:IsA("TextBox") then
	if layer:GetAttribute("Layer") == 1 then
		tweenService:Create(layer, tweenInfo, { TextColor3 = Color3.fromRGB(250, 250, 250)}, {BackgroundColor3 = Color3.fromRGB(45, 45, 45)}):Play()
	elseif layer:GetAttribute("Layer") == 2 then
		tweenService:Create(layer, tweenInfo, { TextColor3 = Color3.fromRGB(200, 200, 200)}, {BackgroundColor3 = Color3.fromRGB(35, 35, 35)}):Play()
	elseif layer:GetAttribute("Layer") == 3 then
		tweenService:Create(layer, tweenInfo, { TextColor3 = Color3.fromRGB(150, 150, 150)}, {BackgroundColor3 = Color3.fromRGB(25, 25, 25)}):Play()
	end		
end

(Sorry for my bad English, i’m from Russia)

This is not how you specify the goal values! You should only use a single table and you put all the properties in there. What you’re doing right now is splitting the table into multiple parameters, of which only one of them actually gets read and used.

Try this:

tweenService:Create(layer, tweenInfo, { TextColor3 = Color3.fromRGB(250, 250, 250), BackgroundColor3 = Color3.fromRGB(45, 45, 45)}):Play()
1 Like

Thanks you for helping! have a great day! :grin:

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