ShadowMute - Mute people in chat without them knowing

What is ShadowMute?

What if you could mute a player from the entire game without them even knowing it? If someone talked, and nobody else could hear them? You may say this sounds a bit sly or uncouth, but you can’t say that it’s ineffective in deterring spammers, beggars, and other villainy. :smiling_imp:

Enter ShadowMute: players can be muted for the whole server, but for them, their own chat messages are still visible. This does work on muted players for whisper and team chat as well.


In this image, Player1 (left) is ShadowMuted. Other players cannot see Player1’s message. Image source at the end of this post.

ShadowMute is a module that allows specified admins to apply this muting power to anyone, in-game or not. Admins get to use this GUI:

The volume buttons can be clicked on to toggle whether or not a player is muted. Alternatively, a username can be entered in the bottom bar for any user, whether they are in the game or not. When a user is muted or unmuted, this mute state saves: if a player is muted, they remain muted even when they join a different server.

I should note that the Player.Chatted listener will still fire regardless of whether a player is muted, so this will not prevent any chat commands from working.

By default, there is a tiny volume icon in the bottom right-hand corner of the screen for admins to toggle this mute menu.

image

This can be turned off in favor of your own opening/closing method.

In addition to this, a separate module can be used to connect ShadowMute to a Discord server. This notifies you whenever one of your admins mutes a user. It does not notify you when a user is unmuted.


How to use ShadowMute

  1. require this module: ShadowMute - Roblox, whether directly from the website or after inserting it into your game (preferably the former if you want potential bugfixes to be automatic).
  2. When required, the module should return a function. Run the function with the first parameter being an array of admin usernames. Your script should look like this:
local ShadowMute = 5590422758 -- Path to the module
local Admins = {"GFink", "koke15", "tyzone"} -- Names of your admins
require(ShadowMute)(Admins)

Connect to Discord

As mentioned, you have the ability here to connect the module to a Discord server to notify when a user is muted. This is done using a web-hook link. To use this module, do this:

  1. Make sure your game’s HttpService request functionality is enabled.
  2. require this module: ShadowMute Webhook - Roblox
  3. Call the returned function with your web-hook link, like so:
local ConnectToWebhook = 5801794215
local WebhookLink = "https://discordapp.com/api/webhooks/123456/ABCD-EFG-123-ETC"
-- Keep your webhook link HIDDEN!
require(ConnectToWebhook)(WebhookLink)

To set up a Discord web-hook, go to your Discord server’s settings and follow the steps in this image.

Customize

I also mentioned that you could change the method of opening or closing the mute menu. Here’s how:

  1. Let’s say you want to have your own button to open and close the menu. In a LocalScript, type up your button-clicking connection as usual, but inside the connected function, check for and then run the function _G._Toggle5 like so:
Button.Activated:Connect(
	function()
		if _G._Toggle5 then
			_G._Toggle5()
		end
	end
)

This will toggle the menu open or closed depending on whether or not it’s currently visible. Alternatively, you can call that same _G function with a true or false value to guarantee if it will be open or closed, regardless of its current state. Note that you don’t need a button specificially, as the menu could be toggled all the same by typing a chat command or touching a brick.

  1. On the server, require the ShadowMute module as usual, but run the returned function with a second parameter true. This tells the module you are using a custom opener so that it doesn’t use the default button in the corner of the screen. The following would be how the module is required, exactly like we did in the beginning but with one small change:
local ShadowMute = 5590422758 -- Path to the module
local Admins = {"GFink", "koke15", "tyzone"} -- Names of your admins
local UsesCustomOpener = true
require(ShadowMute)(Admins, UsesCustomOpener)

Credits

Thanks to @colbert2677 @lesserfantasy for the functionality at the core of this module. See the original discussion about this and his detailed reply here: Soft Mute / Shadow-ban Chat Feature?

Thanks to @iiNemo for his LayoutUtil module that made the ScrollingFrame here work better.

Thanks to my good friend @tyzone for helping test and debug some of the code with me.

34 Likes

Pretty cool, but do you think you should use UserIDs rather than Usernames in the Admins table? I personally think it would work better.

3 Likes

The module automatically converts them to user IDs. Usernames are for better ease of use.

1 Like

If they do get the usernames and convert it, what if an administrator were to change their usernames? Would it still convert it?

The conversion function uses Players::GetUserIdFromNameAsync, which does work for old usernames. Good question but I assure you there’s no problem here.

2 Likes

I mean… /mute (username) doesn’t let them know about the mute either…?

/mute does not mute the player from the server. Everyone else can still talk to them. This module makes it so the only player that can see the sent messages is the person who got muted.

2 Likes

This is pretty neat, Also the connection to a discord webhook is interesting too