Is there a way to limit the ROBLOX in-game chat to restrict people from chatting with people outside their own team? I’m trying to force all players into team chat by default.
Yes, I’ve used this many times in Roblox military groups. In-game, type /t
before your message and it will restrict you to chat within your own team. If you mean getting rid of the global chat entirely, take a look at the chat core scripts.
Yeah, I’m trying to force players into team chat all the time. I’ve tried looking at the chat scripts but have often found trouble dealing with them, so I decided to ask here.
You could manually script one on your own, by checking if the TeamColor is mutual between certain players.
For things like this, the Lua Chat System is actually very useful! To force people into teamchat, all we have to do is mute them in the global chat using the API’s ChatChannel:MuteSpeaker
method. Here’s some sample code below:
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local Global = ChatService:GetChannel("All") -- Global Channel
Global.SpeakerJoined:Connect(function(speakerName)
Global:MuteSpeaker(speakerName)
end)
Also, if you find yourself having trouble with the chat system again, check out this DevHub page: Customizing In-Experience Text Chat | Documentation - Roblox Creator Hub
There are other features across the entire Lua Chat System and it’s modularised hierarchy makes editing and utilising its functionality very easy. There is a method under the ChatSpeaker titled JoinChannel. Instead of muting the speaker, you can force them back to the team chat channel.
On the other hand, if you still need to utilise the global channel for various items but you don’t want speakers to speak in it, then muting is also a viable solution.
I just wanna help people who are using the new TextChatService. It seems much more easier with TextChatService! I love it! Sorry for the bump after 4 years