A friend banned me in my own game,and i cannot unban myself

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)

1 Like

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

1 Like

also that’s not secured with appropriate pcalls which means a ban could fail.
Why not just use the new Ban API?

2 Likes

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.

1 Like

Open the experience in studio, and in command line type the following code:

game:GetService("DataStoreService"):GetDataStore("TimedBans"):RemoveAsync(game.CreatorId)

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.

That’s only through the Ban API, and it would appear the OP is using a data store system.

“DataStore can’t be accessed from client”

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.

alr,uhhhhh,i dont really know what just happened,but it appears,that it somehow just unbanned me

i will ping this,cuz it’s prob the one which worked

1 Like

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