I am trying to make a ban system for my admin commands and it isn't working

I am currently making my Auto Ban if the person seems to be able to speed themselves up or make their jumpier higher when they do not have the permission. It was working and it seems to have stopped since I tried to add a reason to the ban and it stopped working so I removed it and now it broke. It was working before I tried it before adding the reason. I haven’t changed the layout of it as this is what it was before adding the reason!

local function BanExploiter(Player)
	local success, errorm = pcall(function()
		BanStore:SetAsync(Player.Name)	
	end)	
if success then
		local IsBanned =  BanStore:GetAsync(Player.Name)
		if IsBanned == true then
			Player:Kick('\nArriva Game Control\n\n You have been banned from this game for Exploiting.\n\nPlease do not continue to use exploits in games as it ruins the experience for both you and others.\n\n [Code: '..PBanCode..']')
			
			end
		end
end
game.ReplicatedStorage.Checking.OnServerEvent:Connect(BanExploiter)
1 Like

Shouldn’t it be error? I don’t know much about scripting but it doesn’t look right

2 Likes

You’re making it too complex, try doing it with less text

2 Likes

They likely named the variable errorm as it’s short for error message.

It doesn’t work with error as it thinks it is one of the things set by roblox for something. Errorm is for Error Message. Also ignore the logging bit below. The logging bit was just included in the function it has nothing to do with the ban it self. Ill edit it out

Nevermind. I just realised why it wasn’t working. I forgot that I accidentally removed the true thing from the setasync to the database so it was setting my name but not actually realising it was banned as when it checks if the thing is true it doesn’t recognise anything so it fails to work. :slight_smile:

1 Like