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)
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
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.
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.