Why does this "anti cheat" kick legit players

so i made a script which is supposed to kick a player whenever a not allowed gui appears in starter gui (some exploits have a notification gui) but for some reason it kicks legit players as well?
its a local script and its a child of startergui ( and i believe everything inside startergui gets cloned into playergui as well)

local alloweduis = {}
for i,v in pairs(script.Parent:GetChildren()) do
	table.insert(alloweduis,v)
end

script.Parent.ChildAdded:Connect(function(child)
	if not table.find(alloweduis,child) then
		game.Players.LocalPlayer:Kick()
	end
end)
2 Likes

Two things:
1.
AllowedUis is empty,
2:
Three other ScreenGuis are automatically inserted when a player joins the game.
(Chat, Freecam, Shopgui)

huh?
its not empty, but i think i know how to make it work properly already

oh i see, that would make sense. ill try to white list those

actually proximity prompts is the thing that kicks me
image

I dont think kicking players or banning is not a effective solution, btw the problem is there are in-built GUIs that added by roblox if you keep the table empty the player will be auto-kicked

1 Like

Also your anti-cheat can be easily bypassed/disabled since it client sided and please do a clear research about “CoreGUI” next time, happy development.

2 Likes

do you have the list of the auto inserted guis names?
or do you know where to find it

Don’t even bother – exploiters don’t insert their UI into PlayerGui, but rather CoreGui or through external drawing libraries. Patch the vulnerability, not the GUI.

6 Likes

Keep in mind, do not use exploits on your own game. Even if you did dont tell this to anyone :eyes:

damn, i mean to test an anti cheat you need to cheat right

1 Like

Of course not, you can make an admin-like script for testing that incorporates common exploits.

1 Like

AllowedGuis is empty (so it’s banning everyone) and if legitimate players are still experiencing the issue, try looking at core system uis as well.

i have decided not to use this method anymore. i have found a new method of creating an anti cheat

Well please mark someone’s post as solved then so people know.