Can't unban myself after using :BanAsync()

So, I banned myself using the new :BanAsync() API and right after a couple of tests, I tried unbanning myself using the :UnbanAsync() API, but that never worked, so now I permamently locked myself out of my game on ALL my alt accounts; is there anything I can do? UnbanAsync doesn’t do anything other than print out
UnbanAsync will succeed on production game servers. Skipping request in test environment... - Studio
Here’s scripts I used off the documentation itself:
Ban script:

local config: BanConfigType = {
	UserIds = {11667560},
	Duration = -1,
	DisplayReason = "Testing :BanAsync",
	PrivateReason = "this is a test ban",
	ExcludeAltAccounts = false,
	ApplyToUniverse = true
}
local success, err = pcall(function()
	print("banned plr")
	return game:GetService("Players"):UnbanAsync(config)
end)

Unban Script:

	local config: UnbanConfigType = {
		UserIds = {11667560},
		ApplyToUniverse = true
	}
	local success, err = pcall(function()
		return game:GetService("Players"):UnbanAsync(config)
	end)
	print(success, err)

Both were ran on Server Scripts

2 Likes

Are you running both of these at the same time? In case you are, can you try disabling the ban script completely and only running the unban script?

No, I only run the unban script on Server, I have figured out I need to:

  • Give team create to a friend of mine/another device with another account, preferably another internet connection;
  • Run the Unban Script in the console
    I haven’t noticed that it said “Skipping request in test environment…”, so you basically have to run that in a live game instead of Studio, but since I banned my own self I couldn’t do that, pretty stupid way of locking yourself out of your own game, maybe make it idiot-proof, like myself
6 Likes

I know this was marked as a solution but i’m actually curious;

wouldn’t re-publishing the game with a script that unbans you with a delay on it also work or does something prevent that?

THIS EXISTS??

It was introduced recently; you can read about it here: Introducing the Ban API and Alt Account Detection

1 Like

What I tried before, is publishing the game with this script;

game.Players.PlayerAdded:Connect(function(player)
	local config: UnbanConfigType = {
		UserIds = {11667560},
		ApplyToUniverse = true
	}
	local success, err = pcall(function()
		return game:GetService("Players"):UnbanAsync(config)
	end)
	print(success, err)
end)

Didn’t work, maybe I did something wrong, but after running it in the server console it worked fine. Not sure if there has to be a player banning or something

1 Like

This is probably because the ban occurs before the event fires, if it can, that is. If the event doesn’t fire, it’s practically impossible to be unbanned.