So,i gave my friend a ban ui in my game,and he literally banned me forever,and when i join,i just cant even unban myself.i already tried to delete the script,rewrite it fully,but nothing works.
Anyways,here is the script:
local datastoreservice = game:GetService("DataStoreService")
local bandata = datastoreservice:GetDataStore("TimedBans")
script.Parent.Parent.Ban.OnServerEvent:Connect(function(plr,plrtoban,reason,days,status)
local uid = game.Players:GetUserIdFromNameAsync(plrtoban)
local ostime = os.time()
local days = tonumber(days)
local d = days * 86400
local length = d + ostime
local table2 = bandata:SetAsync(uid,{uid,length,reason})
bandata:SetAsync(uid,table2)
status.Text = "Banned: "..plrtoban..""
if game.Players:FindFirstChild(plrtoban) == nil then
print("Not in server")
else
game.Players:FindFirstChild(plrtoban):Kick("You have been banned for:" .. reason .."")
end
end)
you should be able to just do this somewhere in the code:
bandata:RemoveAsync(YOUR_USER_ID)
Also I noticed that how your ban system is set up that anyone can ban anyone if they fire the event, cause you never check if the player triggering it should be allowed to ban people. Just so you know
like @FroDev1002 said, you don’t have safety measures, make a table of players you want to have the admin. and make a for loop through it, if the player matches then fire the ban event else stop them.
Does the creator hub show banned users on the web page? I didn’t ban anybody so I can’t tell if it does or not, there is a button to add a user to the ban list on the web page though.
it jsut prints this " DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 1537937504"
Just add a blacklist function to avoid it. ‘DataStore request was added to queue. If the request queue fills, further requests will be dropped. Try sending fewer requests. Key = 1537937504’ is the message that appears when data is throttled too much.