A pretty simple question but hopefully there is an answer! I am creating an admin panel for a group and wondering how to mute players for everyone using TextChatService.
I am aware of the ChatService:MuteSpeaker() method of the legacy chat service but I don’t seem to be able to find a way to server-mute players using TextChatService.
A better way to do this server side would be to mute any current and future TextSources that match a userId:
local TextChatService = game:GetService("TextChatService")
local function muteUserId(mutedUserId)
-- listen for future TextSources
TextChatService.DescendantAdded:Connect(function(child)
if child:IsA("TextSource") then
if child.UserId == mutedUserId then
child.CanSend = false
end
end
end)
-- mute any current TextSources
for _, child in TextChatService:GetDescendants() do
if child:IsA("TextSource") then
if child.UserId == mutedUserId then
child.CanSend = false
end
end
end
end