so im currently working on a anti-exploit and how can i make a ban system, and temp bans and maybe perm bans if possible.
Hello there,
Exactly this is kinda hard. If you know how to make a kick system when someone exploits it’s easier to make. Exactly is a “Ban System” the exact same thing as the “Kick System”. Only the Ban System uses a DataStore.
I’m not 100% how u need to make this. But I will send some YouTube Ban System Tutorials.
Good luck with creating this and I hope it helped you!
Kind regards,
DutchBuilds.
Basically a “ban” constitutes kicking a player when they join. This is as close as you’ll get on this platform.
How you handle that is up to you. You can use DataStores to mark a player as banned, kicking them when the data is loaded, or a per server basis that only kicks then when they rejoin the server. You can also put time limits, via time stamping the ban so it’s only in effect until that time is met.
End of the day all of these logical decisions come down to a server scripting running :Kick("Insert optional reason here")
on the player you wish to be banned.
I guess you could add the name of a player to an array/table and whenever a player joins the game compare their name to said array. You will have to use Datastore service with this I think
I recently made an admin panel, you may want to check it out.
here’s the file:
Ban.rbxm (21.6 KB)
Includes:
- Warn
- Kick
- Ban
Everything is logged on client (GUI) and google spreadsheets, although I switched it to discord now. All the commands do have an option for reason.
Temporary bans are coming soon, here’s the post I’ll be updating for it:
Here is a simple system that will kick the player if they’re banned:
(Note that to ban someone you should store their user id in the data store, and to unban them you should just remove their id from the data store)
local DataStoreService = game:GetService("DataStoreService")
local BanStore = DataStoreService:GetDataStore("BanStore") -- Or whatever you're calling it
game.Players.PlayerAdded:Connect(function(player)
if BanStore:GetAsync(player.UserId) then
player:Kick("You are banned.")
end
end)
Example of banning someone:
local DataStoreService = game:GetService("DataStoreService")
local BanStore = DataStoreService:GetDataStore("BanStore") -- Or whatever you're calling it
BanStore:SetAsync(player.UserId, true)
Example of unbanning someone:
local DataStoreService = game:GetService("DataStoreService")
local BanStore = DataStoreService:GetDataStore("BanStore") -- Or whatever you're calling it
BanStore:SetAsync(player.UserId, nil)
Having a “BanStore” is really just irrelevant when you can just add a ban boolean.
Ye but it is a lot easier to set data such as a reason and time if it is a temp ban.
No?? Why would you need a different datastore if your main datastore uses tables.
I mean they is using a main datastore lol. He is just getting the name of the data store he is setting to…
Which still uses tables to set data…
He’s using 2 datastores and that’s efficient I don’t know what your pointing out.
He isn’t tho. He is using one.
Who are you talking about?? You literally never mentioned it.
You are confusing me. I am talking to you about your comment you made.
I don’t get it, then why did you put “he” when i was generalising.
What are you even talking about. There is only one person on here who is showing the use of datastores to save bans…
Yeah and he had to create a seperate datastore for it which is inefficient and unnecessary.
No he didn’t. He is using literally the same one.