BanIt - Simple ban module for anyone

Pick up the module!

Check out the source!


BanIt is an open-source banning module that is extremely simple to use. Check out the docs to see what I mean. Don’t feel like it? Here’s an example banning script.

local BanIt = require(6451678459)
BanIt.Ban("Ty_Scripts")

And here’s an unbanning script:

local BanIt = require(6451678459)
BanIt.Unban("Ty_Scripts")

Yes… it’s that simple!

Found any module-breaking bugs? Please reply or send me a DM!
Also, suggestions… please reply here.

Update 11 Poll
  • Allow reason parameter to display at other times than the first kick
  • .UsernameBan (bans the user based on Username, will unban when the username is changed)
  • .DisplayBan (bans a user based on DisplayName, will unban the user when the DisplayName is different)

0 voters

Thanks for considering this module for your banning needs. Again, please notify me of ways to improve the code!

32 Likes

Thanks! I’ll check it out! I might use this module in my game too!

1 Like

I’ve got a suggestion, will you be able to ban with commands such as :ban or :kick eventually? I know you would need a permission system but this would be worth it.

2 Likes

I visualized this as more of a “ban service” meant for programmers, but if enough people support the idea, I could add commands/team up with an existing admin resource.

2 Likes

I have a question. If I ban someone by doing, for example. And they are in a vip server or in another server that is not mine will they still be banned? Basicly if they are playing right now and I ban them.

BanIt.Ban("Ty_Scripts")
2 Likes

That is a good question! It will not kick them. I did not even think of this occuring, so I will add a feature to where it checks for ban updates every 30 seconds soon. Thanks for asking!

1 Like

Aw come on I was legit just developing something like this (Mine was a bit more complicated though). Good job though.

2 Likes

Quick question: how did you get the Players.PlayerAdded event to run on a modulescript? Whenever I try that nothing happens.

1 Like

Since a whopping 92% of you requested it, the TimedBan function has been released!
Below is the snippet from the docs on how to use it.

Thanks for choosing BanIt!

6 Likes

Do I place the script inside the server script storage? Also I can just copy and paste the script instead I change the numbers of an item right?

Shouldn’t the Players:GetUserIdFromNameAsync() calls be wrapped in pcalls?

1 Like

You don’t need to copy and paste the script shown here. You can just require the module:

That’s probably a good idea, I’ll roll it out with the next update (and you can always make a pull request on GitHub if you’d like it fixed before the next update).

Update 7 has been rolled out! I’ll recap what’s available:

  • Ban
  • ServerBan
  • TimedBan
  • ServerUnban
  • Unban
  • When banning, all servers are scanned for the person to be banned (thanks @FelixProfit)
  • Enhanced pcall security (thanks @twinqle)

Update 8, releasing either today or tomorrow, will contain all of the above, and will add:

  • ShadowBan (recently got more votes than SetUnbannable)
1 Like

Also; I noticed you said the username for functions was case sensitive. I only briefly looked at the source, but GetUserIdFromUsername hasn’t been case sensitive for me.

1 Like

So once I have the module I can just instantly make a newer script and do the

and that’s that’s it.

Thank you! I will start using this now :smiley: .

1 Like

You should change the name to temp ban

Basically yes, the server automatically will update the Script when a new update is available.

1 Like

Update 8 is out! 58% of you voted for ShadowBan, so here it is. Here’s the documentation:

Technical details

Some improvements were made to shorten code, based on suggestion by a GitHub user named @ccuser44, were implemented. All pcalls were replaced by xpcalls, and some asserts were added. (Remember to make pull requests for anything you feel needs fixed!)

Thanks for choosing BanIt for all of your banning needs (and be sure to make suggestions)!

1 Like

ShadowBan has been MASSIVELY improved… but not by me. This is why open-source code is the future:

  • More kick messages added
  • Sometimes user appearance does not load
  • Ownership of character is transferred to server to add lag
  • Speed and jump changes are randomly decided
  • AutoRotate is randomly enabled/disabled

Thanks to Github user ccuser44 for the awesome additions!

2 Likes