Changing values via script help

Hello,

I am still new to scripting, I made this script to change a Color3Value when clicking a button. The script is below and does not work.

Does anyone know why this is not working?

black.Activated:Connect(function()
	game.StarterPlayer.StarterPlayerScripts.BubbleChatSettings.BackgroundColorValue.Value = Color3.fromRGB(57, 59, 61)
	game.StarterPlayer.StarterPlayerScripts.BubbleChatSettings.TextColorValue.Value = Color3.fromRGB(250, 250, 250)
end)

Is the button a TextButton / ImageButton? Then otherwise the Activated event will not work because it doesn’t exist at all. Try using the MouseButton1Down event instead of that one.

It is a TextButton. I have used this in all my UIs and I have not had any issue, but I will try.

Also, the code is returning this error shown below. I’ll let you know when I find a solution for this issue.
image

  1. The MouseButton1Down didn’t change anything.

  2. The BubbleChatSettings script is a script I got off of here and added the values under it.

Try this script:

local chat = game:GetService("Chat")
black.MouseButton1Down:Connect(function()
	pcall(function()
		chat:SetBubbleChatSettings({
			BackgroundColor3 = Color3.fromRGB(0, 255, 255), --Customize
			TextColor3 = Color3.fromRGB(255,0,0), --Customize
		})
		--print("done")
	end)
end)

The bubble will look like this, but you can customize it to your preference. Hope this helps :wink:
image

1 Like