How to Mute Players I Deem as Bots

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    a way to mute the in-game chat to a select group of people i deem as bots, i don’t need help checking if the acc is botted, i simply need help figuring out how to mute chat, and then have a way to unmute it if the players passes my bot test.

  2. What is the issue? Include screenshots / videos if possible!
    everything i try is permanent, meaning once i mute it i mute every single in-game user, by disabling chat, i can’t figure out how to temporarily mute it per user.

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I’m not asking for an entire script, I’m just asking for a built-in function name or a way to mute chat function.

2 Likes

I don’t think it would be very necessary considering the fact that a player can mute another player themselves (in the client)

You can use the .CanSend property You have to loop through every descendant in TextChatService and make sure they are a TextSource.

It is necessary as i’m not worried about profanity, im tired of scams where people pretend to be [global] etc. even if people don’t fall for them, it clutters the chat box and is just plain annoying, i’m going to implement this into my game, and possibly make an open-source free plugin that allows you to control the strictness of the bot checker. many games could benefit form this.

also for god’s sake please don’t reply with “i don’t think this is necessary” on scripting support.

How would this be used? I’ve barely touched text service so i don’t know the variable: like
chatservice.CanSend = False ?

Here is the script I used for my admin commands. I am pretty sure that I took it from straight from the documentation though.

local function MuteUserId(mutedUserId, Mute)
	for _,Child in TextChatService:GetDescendants() do
		if Child:IsA("TextSource") then
			if Child.UserId == mutedUserId then
				if Mute then
					Child.CanSend = false
				else
					Child.CanSend = true
				end
			end
		end
	end
end

Note for anyone else using this solution: This only works with the new TextChatService.

Edit: Just found the original post: Mute players with TextChatService - #4 by be_nj

4 Likes

Thanks!

1 Like

You should return after you find the player for an optimization. You can also assign the property in one line.

@Tanks_altNum1
Code:

local function MuteUserId(mutedUserId, Mute)
	for _,Child in TextChatService:GetDescendants() do
		if Child:IsA("TextSource") then
			if Child.UserId == mutedUserId then
				Child.CanSend = not Mute

				return
			end
		end
	end
end
3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.