Introducing the Ban API and Alt Account Detection

I typed 15 minutes but ok…

image

1 minutes?? :thinking:

:sob:

1 Like

I made an update to the default script :slight_smile:

local Players = game:GetService("Players")

-- Example function to determine if a player should be banned
local function shouldBeBanned(player)
    -- Implement your ban logic here
    return true  -- Replace with your actual logic
end

-- Example function to calculate ban duration based on ban history
local function getNextBanDuration(banHistoryPages)
    -- Implement your logic to calculate ban duration based on ban history
    return 3600  -- Replace with your actual logic (e.g., check ban count, severity, etc.)
end

-- Example usage of banning a player
local function banPlayer(player)
    if shouldBeBanned(player) then
        local banHistoryPages = Players:GetBanHistoryAsync(player.UserId)
        local duration = getNextBanDuration(banHistoryPages)

        local config = {
            UserIds = {player.UserId},
            Duration = duration,
            DisplayReason = "You violated community guideline #5",
            PrivateReason = "Exploiting + insult",
            ExcludeAltAccounts = false,
            ApplyToUniverse = true
        }

        local success, err = pcall(function()
            Players:BanAsync(config)
        end)

        if not success then
            warn("Failed to ban player:", err)
        else
            print("Player banned successfully")
        end
    else
        print("Player should not be banned")
    end
end

-- Example: Connect to PlayerAdded event to monitor new players
Players.PlayerAdded:Connect(function(player)
    -- Example: Wait for 5 seconds before checking if the player should be banned
    wait(5)

    -- Example: Call the ban function
    banPlayer(player)
end)
1 Like

It goes off seconds, so if you typed 15 you prob banned yourself for 15 seconds not minutes.

I banned myself and I can’t unban myself. :thinking:

Time to explore the API, I thought there’s a Ban History UI

Will the APIs will be enabled in Studio or will there be an alternative way to unban users? Encountered an issue where my account would be banned in a production environment and not able to unban from a studio one. Also, with the alt account detection making it impossible to join on an alt to unban the user this would be extremely helpful.

Unless I’ve missed something, the only workaround at present seems to be unbanning via the Open Cloud API.

image

2 Likes

I think it’d be helpful if the ban message was actually shown on the experience details page for the user. Right now there’s no indication that you’re banned, not even the play button is disabled.



Also, you shouldn’t be able to downvote an experience if you’re banned from it. I was really hoping that banning a user would prevent that.

Previous systems of immediately kicking users to prevent them from joining was never a good solution because they will just downvote the game. And if you were around on Roblox long enough to remember Personal Building Servers, they’d always get spammed with unfair downvotes from griefers getting banned.

9 Likes

Exploiters are absolutely COOKED.

1 Like

This is how it works ingame if anyone is interested. (third one is alt detection ban)



2 Likes

ALT detection doesn’t seem to work for me (new account & account switcher), I assume this is in some sort of tracking mode and will be activated soon?

What steps did you take to get to your ALT?

1 Like

for those who are tired of french players joining on alts after you kick all of them

local Players = game:GetService("Players")

local BANNED_REGIONS = { "FR" }

local function onPlayerAdded(player: Player)
    local countryCode = player:GetCountryRegionForPlayerAsync()
    if table.find(BANNED_REGIONS, countryCode) == nil then
        return
    end

    Players:BanAsync({
        UserIds = { player.UserId },
        Duration = -1,
        DisplayReason = "you're probably french",
        PrivateReason = countryCode,
        ExcludeAltAccounts = false,
        ApplyToUniverse = true,
    })
end

for _, player in Players:GetPlayers() do
    task.spawn(onPlayerAdded, player)
end

Players.PlayerAdded:Connect(onPlayerAdded)
20 Likes

Exactly one day after me publishing my ban module.
When the banning API was announced at RDC, I put my ban module on hold but since it never came, I have now completed it.
Great timing :sweat_smile:

image

Would be nice if the ban reason was on the game’s page instead of appearing after they join the game:
image

27 Likes

14 years too late but im glad to see it, this is gonna be a banger for people that dont want to put kohls admin in and have minimal scripting knowledge.

2 Likes

holy moly, amazing update. I was so excited for this back in February. Ban API and hopefully a new UI update this month? Roblox is crazyy

1 Like

The API looks good, it would be better tho if it could be used in the studio environment rather than skipping the request, it’s a good way to learn how it works / debug it afterall

1 Like

It appears that regardless of my report on the topic of the alt detection, the false negatives are overwhelmingly alarming over the false positives. In fact, I haven’t received a single false positives because every alt is a false negative.

7 Likes

thank you so much for releasing this and with opencloud support upon release i love you roblox :heart: pls do more good things like this

I think should just not be included, it makes no sense as no other method does that. Filtering text should be developer’s responsibility (using the appropriate text filter API). Developer may not want to filter text that they believe is safe.

1 Like

For UnbanAsync, the ApplyToUniverse field is required (unlike BanAsync). However, the documentation states that it is optional:

image

image

5 Likes

I agree, the filter often censors completely innocent text. Leaving it up to the developer will prevent a bunch of headaches.

2 Likes