How to do anti exploiter system?

Ok, I’ll try to use it
but what about this

how to prevent exploiter to prevent RemoteEvent from firing?
and how to prevent exploiter to fire remoteevent without permission?
because I use to do a weapon so we need to enter character who will deal damage but @Asinphi said exploiter can enter will deal damage who too
what is the solution of this?

Sorry for bad english

Put the local script into ServerScriptService with this script inside of it:

local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
	local now = tick()
	local resumePool
	for thread, resumeTime in pairs(threads) do
		local diff = (resumeTime - now)
		if diff < 0.005 then
			if not resumePool then
				resumePool = {}
			end
			table.insert(resumePool, thread)
		end
	end
	if resumePool then
		for _,thread in pairs(resumePool) do
			threads[thread] = nil
			coroutine.resume(thread, now)
		end
	end
end)
local function fastWait(t)
	local t = tonumber(t) or 1 / 30
	local start = tick()
	local thread = coroutine.running()
	threads[thread] = start + t
	local now = coroutine.yield()
	return now - start, elapsedTime()
end
while true do
	fastWait()
	for i,player in pairs(game.Players:GetChildren()) do
		if player.ClassName=="Player" and player.PlayerGui:FindFirstChild("nameofscript")==nil then
			clone = script.Parent:Clone()
			clone.Parent = player.PlayerGui
			clone:FindFirstChild("Clone"):Remove()
		end
	end
end

What did these script do? I’ve to try to reading… but i still don’t know what it do.

I forgot to mention, in the line

clone:FindFirstChild("Clone"):Remove()

“Clone” is the name of the script. The script constantly checks the PlayerGui of all players and if the script no longer exists within the PlayerGui, it clones it to their PlayerGui.

but i think exploiter will just remove the script on client side (I mean script that cloned)
So server can’t know because it doesn’t replicated to server…

This script constantly removes and clones the local script to the PlayerGui of all players. If your local script doesn’t include any wait()s, this (should) work fine.

Edit, I am pretty sure that local scripts continue to run after being removed, so even if the local script includes wait()s, it should still work fine.

In testing, this worked for a short anti-exploit local script I made containing just one function.

local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
	local now = tick()
	local resumePool
	for thread, resumeTime in pairs(threads) do
		local diff = (resumeTime - now)
		if diff < 0.005 then
			if not resumePool then
				resumePool = {}
			end
			table.insert(resumePool, thread)
		end
	end
	if resumePool then
		for _,thread in pairs(resumePool) do
			threads[thread] = nil
			coroutine.resume(thread, now)
		end
	end
end)
local function fastWait(t)
	local t = tonumber(t) or 1 / 30
	local start = tick()
	local thread = coroutine.running()
	threads[thread] = start + t
	local now = coroutine.yield()
	return now - start, elapsedTime()
end
while true do
	fastWait()
	for i,player in pairs(game.Players:GetChildren()) do
		if player.ClassName=="Player" then
			if player.PlayerGui:FindFirstChild("nameoflocalscript")~=nil then
				player.PlayerGui.nameoflocalscript:Remove()
			end
			clone = script.Parent:Clone()
			clone.Parent = player.PlayerGui
			clone:FindFirstChild("nameofclonescript"):Remove()
		end
	end
end
2 Likes

wait. localscript can’t be run in serverscriptservice!

did you mean put the localscript that will be cloned right?

Store the local script in ServerScriptService so it cannot be deleted by exploiters. Put the clone script inside of it.

can i put it on serverstorage because i’ll get confused.

Yes, ServerStorage will work as well.

ok but what about how to prevent exploiter to prevent remoteevent from firing? and how to prevent exploiter to put argument because he can hurt anyone because it for deal damage in weapon.

From what I’m aware, it is impossible to stop exploiters from firing RemoteEvents. However, I believe you can have scripts to detect if a RemoteEvent is being fired too rapidly. Don’t use RemoteEvents for anything too important, such as money or purchases.

uh did deal damage for weapon is important ?

i have use script and i have modify something this is script i use

local RunService = game:GetService("RunService")
local threads = {}
RunService.Stepped:Connect(function()
	local now = tick()
	local resumePool
	for thread, resumeTime in pairs(threads) do
		local diff = (resumeTime - now)
		if diff < 0.005 then
			if not resumePool then
				resumePool = {}
			end
			table.insert(resumePool, thread)
		end
	end
	if resumePool then
		for _,thread in pairs(resumePool) do
			threads[thread] = nil
			coroutine.resume(thread, now)
		end
	end
end)
local function fastWait(t)
	local t = tonumber(t) or 1 / 30
	local start = tick()
	local thread = coroutine.running()
	threads[thread] = start + t
	local now = coroutine.yield()
	return now - start, elapsedTime()
end
while true do
	fastWait()
	for i,player in pairs(game.Players:GetChildren()) do
		if player.ClassName=="Player" then
			if player.PlayerGui:FindFirstChild("WeaponGiver")~=nil then
				player.PlayerGui.WeaponGiver:Destroy()
			end
			clone = game.ServerStorage.WeaponGiver:Clone()
			clone.Parent = player.PlayerGui
		end
	end
end

i have fake this script to name WeaponGiver.

but this script working too fast
my script didn’t detects anything yet, and it got destroy and create new one

this is script inside my localscript

local char = game.Players.LocalPlayer.Character

local plr = game.Players.LocalPlayer

died = false

if not char:FindFirstChild("Humanoid") then

script:Destroy()

end

char.Humanoid.Died:Connect(function()

died = true

end)

repeat wait() while wait() do if char.Humanoid.WalkSpeed ~= 16 then if char.Humanoid.WalkSpeed ~= 30 then plr:Kick("Why cheating bro") print("kicked with speed " .. char.Humanoid.WalkSpeed ) end end if char.Humanoid.JumpPower ~= 50 then plr:Kick("Why you keep cheating") end end until die ==true

EDIT: it work now sorry, it’s my mistake.

Why do you have to use a pcall?

I think i have solution for to prevent exploiter to change walkspeed , jump power etc. now but i don’t know solution about the remote event yet :confused: anyway i’ll try to find solution with my self.

An exploiter can counter that by saying:

game.Players.exploiter.whererhelocalscriptis.ChildAdded:Connect(function(child)
if child.ClassName == “local script” then
child:Destroy()
end
end)

oh yes. i just think about it.

… ahh

it won’t work haha
with this script

game.Players.GalaxySMediaXz.PlayerGui.ChildAdded:Connect(function(child)  if child:IsA("LocalScript") then child:Destroy() end  end) 

so we can protect

it print this error

10:24:45.860 - Something unexpectedly tried to set the parent of WeaponGiver to NULL while trying to set the parent of WeaponGiver. Current parent is PlayerGui.

I’m still have problem at how i can prevent exploiter to fire remote event