BetterChat V3 | Discontinued

Create a ModuleScript, add it to the Addons > Server with this code:

local teamService = game:GetService("Teams")
local players = game:GetService("Players")
local channelName = "Magical Channel" -- The channel's name

local whitelistedTeams = { -- A list of teams you want whitelisted for the specified channel
	teamService.Alive
}

return function(api)
	local channelModule = api.channel
	local speakerModule = api.speaker

	local channel = channelModule.new(channelName,false)

	local processSpeaker = function(speaker)
		if speaker.isPlayer then
			local playerObject = speaker.player
			local lastTeam;

			local update = function()
				if lastTeam ~= playerObject.Team then
					if table.find(whitelistedTeams,playerObject.Team) then
						speaker:addToChannel(channelName)
					else
						speaker:removeFromChannel(channelName)
					end
					lastTeam = playerObject.Team
				end
			end

			local connection = playerObject:GetPropertyChangedSignal("Team"):Connect(update)
			update()

			playerObject.AncestryChanged:Once(function()
				connection:Disconnect()
			end)
		end
	end

	speakerModule.speakerAdded:Connect(processSpeaker)
	for _,speaker in pairs(speakerModule:getSpeakers()) do
		task.spawn(processSpeaker,speaker)
	end
end

Modify the channel name variable to your liking, and add the teams you want to have access to the channel, and now automatically it will add them to the channel if they’re in the specified team and remove them if they’re not.

1 Like

Go to the source code,
client > modules > core > elements > chatbar

And scroll down to the very bottom at around line 461, and paste this:

userInput.InputBegan:Connect(function(input,gameProcessed)
	if not gameProcessed and input.KeyCode == Enum.KeyCode.Return then
		task.wait()
		focusChatbar(true)
	end
end)

However, to change the text for the chatbar, you will need to mess with Localization, which is in
client > modules > core > lists > localizationTable
between lines 249-267

It will look like this, but these are still the default values.

{
    Key = "GameChat_ChatMain_ChatBarText",
    Values = {
        es = "Para chatear, haz clic aquí o pulsa la tecla \"/\".",
        ja = "チャットするにはここをクリックするか 「 / 」 キーを押します。",
        fr = "Pour discuter, cliquez ici ou sur la touche « / »",
        ["es-es"] = "Para chatear, haz clic aquí o pulsa la tecla \"/\".",
        ["zh-cjv"] = "若要聊天,请点按此处或按下“/”键",
        ["zh-tw"] = "若要聊天,請按下此處或「/」鍵",
        ru = "Чтобы общаться в чате, нажмите здесь или на клавишу «/»",
        ["zh-cn"] = "若要聊天,请点按此处或按下“/”键",
        de = "Klicke zum Chatten hier oder drücke die „/“-Taste.",
        ko = "여기를 클릭하거나 \"/\" 키를 누른 후 채팅을 시작하세요",
        ["pt-br"] = "Para escrever clique aqui ou aperte a tecla \"/\"",
        pt = "Para escrever clique aqui ou aperte a tecla \"/\"",
	    ["en-us"] = "Click here or press '/' to chat.",
        it = "Per chattare, clicca qui o premi il tasto \"/\""
    }
},
1 Like

Thank you for expanding on this. Pointing where to find the localization was very helpful.

1 Like

It works while testing in the studio, however, after publishing and testing it in-game, it does not work.

1 Like

That’s very odd, it could be due to the AncestryChanged function, but I’m not 100% sure. Keep me posted in messages.

Hi everybody! I’ve created a new auto-update plugin you can easily install locally!

updater.rbxm (129.2 KB)

Drag and drop this script into your game, and then save it as a local plugin by right clicking it. I would upload it to Roblox and allow you to install it there, but once again it has been flagged so it has to be done this way.

image

It has three options:

  • Toggle Auto-Update: When you open your game in studio, if it finds better chat, it’ll automatically replace the code and place it where it was before if you moved it to a different location after you forked it
  • Install: Installs the chat system, but it will not disable the default chat, you will need to follow forum instructions for that. Plugins do not have the capability of doing that.
  • Overwrite: This will just overwrite any currently existing code with the most up-to-date version.

I added wait(2) and it seems to work

			playerObject.AncestryChanged:Once(function() wait(2)
				connection:Disconnect()
			end)

I tried wait() and wait(1)

Edit: I had to change it wait(5) because it won’t work on mobile

1 Like

Turns out that just adding wait() does not solve the issue

I simply just removed connection:Disconnect() and it works

1 Like

When you edit a message, it updates in the chat but not the bubble above someone, is that intentional or did you just forget to update the bubble one?

That is correct, there were a lot of nuances into editing a bubble chat after it has been edited.

I can still open it, how are you testing it?

hi, I have a modded version of your chat. Do you have a github repo that we can follow commits and do the same to our versions? We would like to include those bug fixes to our versions without: inspecting all files or opening a different repo

hey, can you update it so you can actually change font with the config? roblox is removing the gotham font and all of your code uses the gotham font, and roblox auto replaces the font with a different font called “Monsterrat”. I checked your code and changing the fonts in the config doesnt really do anything, so I have to manually search each module script in the mainmodule and change the font because it doesnt get the font from the config, its just sets the font to gotham ssm.

please make the config more configurable for color too

1 Like

Which colors are you wanting to be more configurable?

In addition:


image

i was thinking that maybe the background colors of the chat could be configurable
image
like you can see in robloxs normal chat the chatbar is black and the background thats a little transparent is darker than betterchats. also yes monsterrat is deprecated because its something to do with the new “Builder” font, they deprecated it but you can still use it in ui like text labels and stuff, while you cant use gotham. heres a post you can look into to see that they are replacing gotham with builder: Introducing Builder Font + Deprecating Gotham and Arial because of this when i try to use betterchat all the fonts are monsterrat

1 Like

by the way, you can join your testing game (V3 Testing Public - Roblox) and see that the font is monsterrat and not gotham.
image

is this compatible with topbar v3?

It should be if you have it installed in your game already, it will search for the TopbarPlusReference value in ReplicatedStorage, so I would likely recommend making sure you have a PlayerScript that will instantly load it so it won’t try to load the V2 mod that it has. If it does not work, let me know and I can make an update for you.

Hello everyone! I’ve just ported the chat system to GitHub:

I’ve also done a small update which adds TopbarV3 support officially.

2 Likes