So earlier I was trying to make a video on how to use the ban API (BanAsync() and UnbanAsync()), and when i banned my alt and told it to include banning ‘alt accounts’, i ended up getting both my main and alt banned permanently. I tried several things like deleting the script, trying UnbanAsync(), and both failed. I am not sure what to do.
Edit: I have run the script in both a studio testing session, and also a roblox client (play) session.
Expected behavior
If UnbanAsync() is used, the userIDs should be unbanned, and not stay banned/perm-banned.
I thought there was a similar topic being created reporting this:
Maybe your Script couldn’t work in time before the BanAPI detects you and removes you from the game? You can try getting another alt to join the game with the UnbanAsync, as some people said that the alt-detection may sometimes fail
There are some rather hacks solutions in the topic attached. While engineers are still creating a page on the Creator Hub to manage the BanAPI for games, people would have to rely on the OpenCloud API to unban themselves for now
The game has to be run normally like played public for unbanAsync to take effect I’m pretty sure. It would be nice for it to just be able to run it without being ran like such though.
I tried that code in my test place and it succeeded. Can you comment the place ID from which you ran this code so that I can look into our logs to try to figure out what happened?
In the meantime, here are some other things you can try to debug your issue:
As mentioned by some of the other creators in this thread, make sure you are running this code on a live production game server rather than in a test environment such as in Studio.
Put the functions calls within a pcall as the code sample in the documentation suggests so that you are able to catch any errors and print them out. Perhaps there are networking issues at play.
The unban is not taking effect because you created a place level ban, but you are creating a universe level unban. The universe level unban does not override the place level ban you created, so the user is still effectively banned. For the unban to take effect, set ApplyToUniverse to false in the unban call.
I will update the documentation to reflect this soon. Thank you for bringing this to our attention.