As a Roblox developer, the BanAsync() feature is currently limited, as it only allows you to prevent players from joining your game.
As the owner of Spray Paint, there are hundreds of cases every day where my moderators want to restrict specific in-game privileges, such as chatting or accessing tools, when a full ban would be too harsh.
Developers should be able to define custom ban behavior. The config argument of BanAsync() should support two new parameters. The first is a new enum, BanBehavior (Enum.BanBehavior.Default and Enum.BanBehavior.Custom). The second parameter would be a metadata table to store data for custom bans to determine how the player should be handled when they rejoin.
This could look something like this:
local function banPlayer(player: Player) -- Example of new BanAsync() parameters
game.Players:BanAsync({
UserIds = {Player.UserId},
Duration = 3600 * 24,
DisplayReason = "Chat offense",
PrivateReason = "Bullying",
Metadata = {Type = "Chat"}, -- Used to store data for custom bans
Behavior = Enum.BanBehavior.Custom -- If Custom is chosen instead of Default, banning will not kick the player like normal
})
end
-- This could be a new method to handle when a player is first banned and when they rejoin
Players.PlayerBanned:Connect(function(player: Player, banData)
if banData.Metadata.Type == "Chat" then
mutePlayer(player)
end
end
Issues With Current Methods
Currently, developers are limited to using DataStores to implement custom ban behavior. Several problems arise from this:
- Bans are often stored in multiple places (DataStore bans aren’t displayed in the Creator Dashboard with
BanAsync()bans, making accessing and modifying ban data more complex) - DataStore bans cannot support alt-account detection
- DataStores can be more unreliable without proper safeguards from rate limits and data loss
- Detecting accounts that are in other servers in the game often requires use of MessagingService (
BanAsynchandles this automatically and reliably)
Example Use Cases
- Chat banning players who are harassing others
- Tool banning players who are spamming loud audio from a boombox gear
- Creating a custom in-game UI for bans (many games already do this to integrate an in-game appeal system)
- Banning players from using a vote kick feature if they are abusing it
- Teleporting banned exploiters to a jail cell where other players can laugh at them