.UnbanAsync not working (pcall yielded forever not returning anything)

local players=game:GetService("Players")
local unbanasync=players.UnbanAsync
local uids={}

print("locals")

local function unbanPlayers(tbl)
    return pcall(unbanasync,players,tbl)
end
print("calling unbanplayers")
local isBanningEnabled,result=unbanPlayers({UserIds={},ApplyToUniverse=true})
print(isBanningEnabled,result,"result")

is this because i did something wrong or indexing players.UnbanAsync doesnt work even tho im passing players as self argument and then unban table

it just gets yielded forever in live server and pcall doesnt even return anything

works in studio but yields forever on a live server

ok actually adding valid userid to the userids table fixed the problem

still weird engine bug that it yields the entire script instead of returning error that the table is empty

local players=game:GetService("Players")
local unbanasync=players.UnbanAsync
local uids={}

print("locals")

local function unbanPlayers(tbl)
    return pcall(unbanasync,players,tbl)
end
print("calling unbanplayers")
local isBanningEnabled,result=unbanPlayers({UserIds={1},ApplyToUniverse=true})
print(isBanningEnabled,result,"result")

yet in studio empty UserIds={} normally works it should return error bc this can yield and confuse developers if for some reason they pass empty table

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.