How to make a dark chat toggle?

I am wondering how I would make a text button that when you click it changes the local players chat to dark color including other players chat bubbles. I am using this for like a dark mode setting in my game. How would I do this?

2 Likes

local player = game.Players.LocalPlayer

local gui = player.PlayerGui:WaitForChild("ScreenGui")

local chat = game:GetService("Chat")

local clicked = false

gui.TextButton.MouseButton1Down:Connect(function()

clicked = not clicked

if clicked == true then

chat:SetBubbleChatSettings({BackgroundColor3 = Color3.fromRGB(0,0,0), TextColor3 = Color3.fromRGB(255, 255, 255)})

else

chat:SetBubbleChatSettings({BackgroundColor3 = Color3.fromRGB(250, 250, 250), TextColor3 = Color3.fromRGB(57, 59, 61)})

end

end)

chat.BubbleChatEnabled = true

Hope this helps :slight_smile:

2 Likes