I want a script that can check a specific player’s Userid and see if they have been banned or not as a bool value. I WANT TO KNOW IF THEY ARE BANNED OFF OF ROBLOX ENTIRELY! I couldn’t find anything about this topic, I only got things about ban panels and how to kick people so I thought I would make a topic about this.
Please reply to this topic if you have any answers or ideas.
Research the DataStoreService, it lets you have data persisting across sessions. Ideally you would store the userids of banned people, then check if they are in the list when they join the game, if they are then :Kick()
If you just want a basic script where you manually set if they’re banned you could create a table of user ids and check when users join if their id matches one in the list, if it does then you could kick them.
I don’t know if there’s a way within roblox studio to do this sadly, not sure what the use case would be either as they are unable to access your game due to their platform ban.
There is actually an available API for this. Here’s the script I wrote.
local http = game:GetService("HttpService")
local baseUrl = "https://users.roproxy.com/v1/users"
local function checkIfTerminated(userId)
local payload = {
["userIds"] = {userId},
["excludeBannedUsers"] = true
}
local success, result = pcall(function()
return http:JSONEncode(payload)
end)
if success then
if result then
local success2, result2 = pcall(function()
return http:PostAsync(baseUrl, result)
end)
if success2 then
if result2 then
local success3, result3 = pcall(function()
return http:JSONDecode(result2)
end)
if success3 then
if result3 then
if result3.data[1] then
return false
else
return true
end
end
else
warn(result3)
end
end
else
warn(result2)
end
end
else
warn(result)
end
end
local isTerminated = checkIfTerminated(1) --Roblox's ID.
print(isTerminated) --false
isTerminated = checkIfTerminated(8166491) --1x1x1x1's ID.
print(isTerminated) --true
This was the API endpoint I used, it has an optional parameter which allows for you to exclude banned users from the query, this can be used to determine if a user is banned or not.
just check the players username like Gameboy5704 and look up their player id. Just search their name in the search players box at the front page and search their username. if their profile picture/avatar doesnt show up in the search results then their banned