Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i check if a roblox player is banned from roblox? [SOLVED]

Asked by 3 years ago
Edited 3 years ago

might seem wierd, but i actually need to know this before making datastores, because in the UK, you legally have to remove someone from the datastores if they get banned off the site. so lets say someone from the UK plays the game and gets banned from roblox for some reason, i would have to manually remove thier data from the data store, might seem like not that much of a pain at first glance, but when the game gets popular, thats when things are gonna get harder, because that means more banned people, basically meaing no breaks. if i can get a system to automatically do this for me, then please tell me how. thanks!

SOLUTION:

local Players = game:GetService("Players")
local cache = {}
function getUsernameFromUserId(userId)
    if cache[userId] then return cache[userId] end
    local player = Players:GetPlayerByUserId(userId)
    if player then
        cache[userId] = player.Name
        return player.Name
    end 
    local name
    pcall(function ()
        name = Players:GetNameFromUserIdAsync(userId)
    end)
    cache[userId] = name
    return name
end
if getUsernameFromUserId(4) == nil then
    print("they gone")
end
0
im not sure really. I dont think you have to. Anyways i think itl will delete automaticly. I dont think you have to worry about this. cancle5 120 — 3y
0
"i dont think you have to" its kind of the law mate, i hope it does delete it automatically oherwise ill be in massive legal trouble. TheEnderG 7 — 3y

Answer this question