I believe so, you can check scripts because your the one banning the person. This feature allows you to ban in studio or whatever.
If your script somehow looks like this then you can
local playerToBan = game.Players:GetPlayerByName("PlayerName")
if playerToBan then
local success, errorMessage = pcall(function()
playerToBan:BanAsync("Inappropriate behavior", 7)
end)
if success then
print("Player has been banned successfully.")
else
warn("Error banning player: " .. errorMessage)
end
else
warn("Player not found.")
end
See how there is a PlayerName?
That’s how you check/remember.
Releases beta version of banning APIs: BanAsync and UnbanAsync
It’s not available for developers to use yet, as it still shows Pending. It won’t take effect until it’s updated to the status of Live.
I’d imagine there will be a way to check, or else there could end up being situations where malicious free models use that API to ban everyone that joins a game without any way for the owner(s) of a game to know with 100% certainty how many players were banned and who specifically was banned.
Once the feature becomes available for developers to use, it’s very likely that there will be an announcement on the Developer Forum about it which details how it works, including an explanation for how a developer can check who has been banned from their game.
local players = game:GetService('Players')
players.BanAsync({UserIds = {1,2}, Duration = 7, DisplayReason = "String" }) -- There are more options. (Duration is in seconds)
There isnt an actual way but what u can do i use players:GetBanHistoryAsync() and just loop thru the table it gives to see if there is a ban that is active (By checking if the BanHistoryPages.Ban1.Ban equals true)
So, when they first announced this update a few months ago, i started working on a plugin. I set up everything so when they released the update, all I had to do was add the ban/unban command.
Sadly, after testing, i get an error:
BanAsync() can only be called on the server
It is a server script
Here is my script:
local config: BanConfigType = {
UserIds = {2758548757},
Duration = 500,
DisplayReason = 'test',
PrivateReason = 'test2',
ExcludeAltAccounts = false,
ApplyToUniverse = true
}
local success, err = pcall(function()
return Players:BanAsync(config)
end)
if success then
print(success)
else
warn(err)
end