Need help banning exploits

Hello everyone! I am currently trying to ban exploits. Here is a not working script for trying to ban the Ultimate Trolling GUI

game.Players.PlayerAdded:Connect(function(plr)
	while wait() do
		if plr.PlayerGui.AccessUI ~= nil then
			plr:Kick("You have been kicked for violating the WEstudios Terms of Service - Exploiting is not allowed. ")
			print("An exploiter has been kicked. ")
		end
	end
end)

If you can help make it work, please let me know. I also tried if plr.PlayerGui.AccessUI then and that didn’t work.

use if plr.PlayerGui:FindFirstChild("AccessUI") then
Also, I don’t know why you would use a while wait() do as you can just use something like this:

game.Players.PlayerAdded:Connect(function(plr)
    plr.PlayerGui.DescendantAdded:Connect(function(desc) --You can also use ChildAdded
        if desc.Name == "AccessUI" then
            plr:Kick("You have been kicked for violating the WEstudios Terms of Service - Exploiting is not allwoed")
            print("An exploiter has been kicked")
        end
    end)
end)

Try this

game.Players.PlayerAdded:Connect(function(plr)
	while wait() do
		if plr.PlayerGui.AccessUI then
			plr:Kick("You have been kicked for violating the WEstudios Terms of Service - Exploiting is not allowed. ")
			print("An exploiter has been kicked. ")
		end
	end
end)

Sorry. I already tried that first. It didn’t work

Try plr:WaitForChild("PlayerGui").AccessUI

Trying to detect exploits through PlayerGui is not going to get you much help. There is some well know injectors that are able to access higher script levels which have access to CoreGUI, which is not replicated making it undetectable by server side scripts. And not to mention that even if you don’t have access to CoreGui through higher level scripts they can just alter the name of the GUI in the code they inject to the game.


The script your provided is an infinite loop which has no break condition so it is likley Roblox is breaking out of the loop for the sake of not freezing your game.

2 Likes