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
- Chat Commands:
- To ban a player: !ban username
- To unban a player: !unban username
- Admin Management:
- Add or remove admin user IDs in the
ADMINS
table at the top of the script.
- Ban and Kick Messages:
- Customize ban or kick messages by modifying the strings in the
player:Kick()
calls.
- Notification Messages:
- Customize the notification messages by modifying the strings in the
showNotification()
function.
- Enable/Disable GUI Notifications:
- Set
GUI_NOTIFICATION_ENABLED
totrue
to enable GUI notifications, orfalse
to disable them.
- Unban Whitelist:
- Add user IDs to the
UNBAN_WHITELIST
table to allow specified users to unban players without joining the game.
- How to Add the Script to Your Game:
-
Get the model from the Roblox library: Ban System Model https://create.roblox.com/store/asset/18398974422/BanCommand
Insert the model into your game. -
Move the script to
ServerScriptService
.