Pick up the module!
Check out the source!
BanIt is an open-source banning module that is simple to use. Check out the extremely docs to see what I mean. Don’t feel like it? Here’s an example banning script.
local BanIt = require(6451678459)
And here’s an unbanning script:
local BanIt = require(6451678459)
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
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)
Thanks for considering this module for your banning needs. Again, please notify me of ways to improve the code!
Thanks! I’ll check it out! I might use this module in my game too!
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.
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.
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.
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!
Aw come on I was legit just developing something like this (Mine was a bit more complicated though). Good job though.
Quick question: how did you get the Players.PlayerAdded event to run on a modulescript? Whenever I try that nothing happens.
Since a whopping
of you requested it, the TimedBan function has been released! 92%
Below is the snippet from the docs on how to use it.
playerToBan , number
length , string
TimedBan works by having a number and type input into it, like so:
BanIt.TimedBan("Ty_Scripts", 2, "days")
Accepted types are:
Make sure that
playerToBan is a
string containing only the username (case-sensitive) of the user being banned . Make sure a type is input along with the length–it is required!
Thanks for choosing BanIt!
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?
Players:GetUserIdFromNameAsync() calls be wrapped in pcalls?
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:
When banning, all servers are scanned for the person to be banned (thanks
@FelixProfit) Enhanced pcall security (thanks
Update 8, releasing either today or tomorrow, will contain all of the above, and will add:
ShadowBan (recently got more votes than SetUnbannable)
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.
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
You should change the name to temp ban
Basically yes, the server automatically will update the Script when a new update is available.
Update 8 is out! 58% of you voted for ShadowBan, so here it is. Here’s the documentation:
ShadowBan lets the player play the game for 45 seconds, albeit with low WalkSpeed and JumpPower, then kicks them with a phony yet convincing error message.
For troubleshooting, see troubleshooting for BanIt.Ban. BanIt.ShadowUnban
Unbans a user from a ShadowBan.
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)!
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!