Unban Async not working

Hey everyone, I’m using this admin panel and everything is working except unban, I’m not a scripter so I’m confused on how I would fix/replace this. I banned my friend to test and tried putting his id in the unban textbox and this error came up. I left the code and F9 screenshot below, thanks.

c06bf8827e0938d80aad4fd1ab513e77

game.ReplicatedStorage.AdminEvent:FireAllClients(arg2)
elseif action == “Unban” then
if game.Players:GetUserIdFromNameAsync(arg2) then
Ban:SetAsync(game.Players:GetUserIdFromNameAsync(arg2),nil)

That is, the target user does not exist in roblox.

Please double check username that you trying to unban

Yeah, are you sure the name is right?

This just wont error randomly, only errors if the user does not exist, try checking caps, and spelling

The unban textbox is looking for a username, not an id. Try with his name instead.

3 Likes

now its saying somethings wrong with

Ban:SetAsync(game.Players:GetUserIdFromNameAsync(arg2),nil)

a103f4c0a6ccedb7585851e81e4d2ac3

2 Likes

Oh, you can’t SetAsync to nil. Try RemoveAsync instead (you can remove the , nil in the parens if you do that).

3 Likes