BetterChat V3 | Discontinued

I don’t see why not, I can implement that when I fix the formatting issue mentioned in the aforementioned post.

1 Like

1.1.3

  • Added it so that adding a backslash before your message will disable formatting (@nekropost)
  • Fixed message bug
  • Fixed quick chat not working for formatted messages (@Stonetr03)
  • Added missing folders for Rojo (@Stonetr03)
2 Likes

New Update gives me the “Module did not return exactly one value”

I got the update from this rbxl:
1.1.3.rbxl (412.6 KB)

This is my game which the errors occurs in:
Game

The error is consistent in 3 diffrent places with no scripts.
(It is still functional i think)

2 Likes

Sorry! Delete the “_placeholder” server addon. Going to update the repo.

Edit: Done now.

2 Likes

Ah, did not bother to look there

Great resource by the way! Its absolutely necessary for all of my games now

1 Like

Hi, Ive been using your better chat module over the course of about a week now and players have been noticing lots of lag upon looking at the center of the map (I’m assuming because all the players are in frame) I don’t know what is happening here, but it seems to be linked to your module

After many long hours of debugging I found that from the script profiler, your Raycast and WorldToViewportPoint calls are insanely high. When the game ends, all the players stop moving, which causes this to fix.

Do you know what could be happening here?

Edit: I’ve traced it back to this:

	local linkAlwaysOnTop = function(gui,adornee,link)
		link = link or function() end
		local camera = workspace.CurrentCamera
		local raycastParams = RaycastParams.new()
		raycastParams.IgnoreWater = true
		raycastParams.FilterType = Enum.RaycastFilterType.Exclude
		raycastParams.FilterDescendantsInstances = {adornee.Parent}
		link(camera.Changed:Connect(function()
			local vector,inViewport = camera:WorldToViewportPoint(adornee.Position)
			local onScreen = inViewport and vector.Z > 0
			if(onScreen) then
				local raycastResult = workspace:Raycast(camera.CFrame.Position,(adornee.Position - camera.CFrame.Position),raycastParams)
				local isVisible = not raycastResult
				gui.AlwaysOnTop = isVisible
			else
				gui.AlwaysOnTop = false
			end
		end))
	end

I’m sorry this is causing lag! To disable that function, you can set useRaycastingToDetermineVisibility to false at the top of the same script.

Thank you! This seems to have fixed the issue.

1 Like

I am working on an update for this, I’d like to know a few things if possible.

    1. About how far away would you say the center of the map would be in studs? (> 500 studs?)
    1. How many players are averaging when this occurs?

Ok! Thanks for your help, Much appreciated

1 Like

What’s your use-case for this? If you’re not an advanced programmer, it may be quite difficult to bind it to a custom topbar button. I will say it is controlled in the ‘load’ LocalScript found here, on lines 587-609.

image

Here, you could delete the parts referencing connections and add a custom topbar option that makes container.Visible equal to the state you want it to be visible with.

My use case is simply to toggle BetterChatV3 using a Topbar icon instead of the roblox core gui Button.

Ah, Well i was trying to disable/Enable it using a bindable… LOL

This is pretty Mediocre Code for me but this is an example

--//References
local container  = script.Parent
local Icon = require(container.Icon)

--Services
local LightingService = game:GetService("Lighting")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DataStoreService = game:GetService("DataStoreService")
local StarterGui = game:GetService("StarterGui")
local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui


--//Variables
local Players = game.Players
local Character = Players.LocalPlayer.Character

--//Communication
local Communication = ReplicatedStorage.Communication

local Remotes = Communication.Remotes
local Bindables = Communication.Bindables

local SetUpRemote = Remotes.SetUp.SetUp

local PlayerListBindable = Bindables.PlayerList.Toggle
local ChatBindable = Bindables.Chat.Toggle

--//UI
local LocalPlayerGui = Players.LocalPlayer.PlayerGui

local CoreGui = LocalPlayerGui:WaitForChild("Core")

local SettingsGui = CoreGui.Settings

--//Holders
local CurrentCharacter = ("[Hero]")



--//Chat
Icon.new()

	:setLabel("")
	:setCaption("Chat")
	:setImage(13150312873, "Deselected")
	:setImage(13150313351, "Selected")

	:bindEvent("selected",function()
		ChatBindable:Invoke()
	end)
	:bindEvent("deselected",function()
		ChatBindable:Invoke()
	end)




--//PlayerList
Icon.new()

	:setLabel("")
	:setCaption("PlayerList")
	:setImage(13150313200, "Deselected")
	:setImage(13150313058, "Selected")

	:bindEvent("selected",function()
		PlayerListBindable:Invoke()
	end)
	:bindEvent("deselected",function()
		PlayerListBindable:Invoke()
	end)



--//Characters
Icon.new()
	
	:setLabel("Characters")
	:setCaption(CurrentCharacter)
	:setImage(13455342593, "Deselected")
	:setImage(13455342746, "Selected")
	
	:setDropdown({
		
		--Hero
		Icon.new()
		
		:setLabel("Hero")
		:setImage(17262129975)
		
		:autoDeselect(true)
		:oneClick(true)
		
		:bindEvent("selected",function()
			SetUpRemote:FireServer("Hero")
		end),
		
		--Slayer
		Icon.new()
		
		:setLabel("Slayer")
		:setImage(17262129975)
		
		:autoDeselect(true)
		:oneClick(true)
		
		:bindEvent("selected",function()
			SetUpRemote:FireServer("Brute")
		end),
		
		--Brute
		Icon.new()
		
		:setLabel("Brute")
		:setImage(17262129975)
		
		:autoDeselect(true)
		:oneClick(true)
		
		:bindEvent("selected",function()
			SetUpRemote:FireServer("Slayer")
		end)

	})



--//Menu
Icon.new()
	
	:setLabel("Menu")
	:setImage(16008997792, "Deselected")
	:setImage(16009009043, "Selected")
	
	:bindToggleKey(Enum.KeyCode.V)


	
	
	
	--[[
	:bindEvent("selected",function()
		SettingsGui.Enabled = true
	end)
	:bindEvent("deselected",function()
		SettingsGui.Enabled = false
	end)
	--]]

Ill try doing that and let you know.
Deleting connections never goes good for me though

Ok so, Its working (Thankfully)
But Just to make sure I didnt mess with the functionality…

Here is what I did (The lines 584-609)

Would what I did cause problems? Any Adjustments?

		local chatOpenState = false
		local locked = false
		
		local toggleChatState = function()
			if(locked) then
				return
			end
			connections:Fire("ChatWindow","VisibilityStateChanged",(not chatOpenState))
			chatOpenState = not chatOpenState
			container.Visible = chatOpenState
		end
		
		function environment:setChatOpenState(state)
			chatOpenState = state
		end
		
		function environment:setChatLocked(state)
			locked = state
		end
		
		local ReplicatedStorage = game:GetService("ReplicatedStorage")
		
		local Communication = ReplicatedStorage.Communication
		
		local Bindables = Communication.Bindables
		
		local ChatBindable = Bindables.Chat.Toggle
		
		connections:Connect("ChatWindow","ToggleVisibility",toggleChatState)
		toggleChatState()
		
		ChatBindable.OnInvoke = function()
			
			connections:Connect("ChatWindow","ToggleVisibility",toggleChatState)
			toggleChatState()
		end
		
		connections:Connect("ChatWindow","CoreGuiEnabled",function(state)
			container.Visible = state
		end)

I don’t see anything wrong here, let me know if you encounter any problems.

Ok! Thanks for your help, Much appreciated

The map isn’t very large at all, and is definitely smaller than 500 studs in diameter. It seemed that as the game progressed, more lag happened. There was an average of 20 players in each game, and I think the issue might be connected to how many times the players respawned…

1 Like

Hello! Wondering If there is essnetially a “State” for this.

Im currently trying to disable Visibility of the chat when the Escape Menu is opened in game.

However the code I ended up using could get bugged out so I was wondering if there is like a variable that controls whether the chat can be enabled or not.

And, if the chatbar is already closed it will instead open it when its supposed to close

Probably going to connect a GuiService:EscMenuOpend instead of bindables.
Modified version of lines 587-609:

		local ReplicatedStorage = game:GetService("ReplicatedStorage")
		
		local Communication = ReplicatedStorage.Communication
		
		local Bindables = Communication.Bindables
		
		local ChatBindable = Bindables.UI.Chat.Toggle
		
		local DisableUIBinadable = Bindables.UI.DisableAllUI
		local EnableAllUIBinadable = Bindables.UI.EnableAllUI
		
		DisableUIBinadable.OnInvoke = function()
			
			connections:Connect("ChatWindow","ToggleVisibility",toggleChatState)
			toggleChatState()
			
		end
		
		EnableAllUIBinadable.OnInvoke = function()

			connections:Connect("ChatWindow","ToggleVisibility",toggleChatState)
			toggleChatState()

		end
		
		ChatBindable.OnInvoke = function()
			
			connections:Connect("ChatWindow","ToggleVisibility",toggleChatState)
			toggleChatState()
		end
		
		connections:Connect("ChatWindow","CoreGuiEnabled",function(state)
			container.Visible = state
		end)

Thank you!!

local doOpenLater = false

-- on escape open:
if chatOpenState then
toggleChatState()
doOpenLater = true
end

-- on escape close:
if doOpenLater then
toggleChatState()
end

Maybe something along these lines?

I’m having an issue where upon joining a server all the chat messages are loaded twice. No errors in output to go off of. I’m assuming I did the install or configuration incorrectly?