Hi, I was coding a admin script and i ban myself it did worked success but i tried unbanning myself and i dont know how to do it. Here the script:
ReplicatedStorage.Remotes.Unban.OnServerEvent:Connect(function(plr)
local s,e = pcall(function()
BannedPlayers:RemoveAsync(plr.UserId)
end)
if not s then
TestService:Error(e)
else
print("Unbanned Success")
end
end)
ReplicatedStorage.Remotes.Ban.OnServerEvent:Connect(function(plr, reason, duration)
local s, e = pcall(function()
BannedPlayers:SetAsync(plr.UserId,{['Name'] = plr.Name,['UserId'] = plr.UserId, ['Reason'] = reason})
end)
if not s then
TestService:Error(e)
else
plr:Kick("You're Been Banned \n Reason: \n"..reason.."\n Duration: "..duration)
end
end)