UnbanAsync() does not work

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.

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

Can you show me your UnbanAsync script? I’m pretty sure this works… it might just appear to be bugged because of poor code.

Also, this bug is in the wrong category. It should be in engine bugs.

I believe it depends on ApplyToUniverse

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.

Can you share the code you are using to call BanAsync and UnbanAsync?

Please note that deleting the script would not undo any ban calls that have already succeeded.

image
image

Are you by-chance running this in Studio? Calls made to the API while in Studio are documented to not work as the API only works in a live experience.

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:

  1. 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.
  2. 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.
  3. Experiment with the User Restrictions Open Cloud API.