How to make an unban-command?

Hi! So I’ve been wondering about how to make an unban-command.
A ban-command is pretty easy, you type in :ban userName and then set an Async for his username, after that kick him. Also make a GetAsync when someone joins a game and check if he is banned or not.
But how would I do that with an unban command, he may not be in the game.

Thank you!

2 Likes

So assuming you already know how to update a DataStore to have the player banned, you would just remove their key from the DataStore or change its value. If they are not in the game, you can still use:

game.Players:GetUserIdFromNameAsync()
8 Likes