Ban Chat Command

Roblox Ban System Script

Key Features

  • Ban and Unban Commands: Admins can ban and unban players using chat commands.
  • Admin Protection: Admins cannot ban themselves or other admins.
  • Persistent Bans: Uses DataStore to keep a record of banned players, ensuring bans persist across server sessions.
  • GUI Notifications: Optional GUI notifications can be enabled to inform admins when a player is not found.
  • Unban Whitelist: A whitelist allows specified users to unban players without joining the game.

Usage Instructions

  1. Chat Commands:
  • To ban a player: !ban username
  • To unban a player: !unban username
  1. Admin Management:
  • Add or remove admin user IDs in the ADMINS table at the top of the script.
  1. Ban and Kick Messages:
  • Customize ban or kick messages by modifying the strings in the player:Kick() calls.
  1. Notification Messages:
  • Customize the notification messages by modifying the strings in the showNotification() function.
  1. Enable/Disable GUI Notifications:
  • Set GUI_NOTIFICATION_ENABLED to true to enable GUI notifications, or false to disable them.
  1. Unban Whitelist:
  • Add user IDs to the UNBAN_WHITELIST table to allow specified users to unban players without joining the game.
  1. How to Add the Script to Your Game:
4 Likes

image

1 Like

I’m sorry, I’ll fix this right now. Thanks for letting me know; you should be all set

It’s great system, but I have a suggestion. Please add option for providing permission for people who has specific rank at group. Thank you!

As a work around, in the PlayerAdded connection, you can include this:

if player:GetRankInGroup(0000) == 000 and not table.find(ADMINS, player.UserId) then -- group id
    table.insert(ADMINS, player.UserId)
end

(Or, if you want to have a minimum rank)

--                                  V- minimum group rank
if (player:GetRankInGroup(0000) >= 100) and not table.find(ADMINS, player.UserId) then -- group id
    table.insert(ADMINS, player.UserId)
end

Thank you so much, you’ve really helped me! :smiley:

Does this not use the new Ban API?

1 Like

No, to be honest, I was just posting an old draft. This script uses DataStoreService for handling bans

I see a someone helped you solve your problem. Thanks for the idea! I’m adding a feature to enable and disable group functions, along with specifying ban reasons and durations. I’ll share the new model link when it’s finished.