Making an AntiExploit System. Thoughts on Efficiency

This is an attempted improvement for my anticheat against the current exploit. More context here

Hi there, you may have heard about the exploit that can frame you if you have your game still public. I understand that it might be fixed soon, but in the meantime, I wanted to make this system to ensure that the game can defend well against this exploit.

I just want to know if this would work against the current exploit and if there are other things I should improve on to strengthen this system.

local CP = game:GetService("ContentProvider")
local regulatedplayers = {}

game.Workspace.ChildAdded:Connect(function(WorkspaceItem)
	if WorkspaceItem ~= game.Workspace.SpawnLocation then
		local destroyable = false
		for i, v in pairs(game.Players:GetChildren()) do
			if WorkspaceItem:FindFirstAncestor(v.Character) then
				destroyable = true
			end
		end
		if destroyable == true then
			WorkspaceItem:Destroy()
		end
	end
end)

local function createcframeholder(item, Player)
	local strike = 0
	local debounce = false
	if item:IsA("BasePart") or item:IsA("UnionOperation") or item:IsA("MeshPart") then
		local itemPos = item.Position
		local itemOrientation = item.Orientation
		local itemsize = item.Size
		item.Anchored = true

		item.Changed:Connect(function(Value)
			if debounce == true then
			else
				debounce = true
				print("Anticheat, Changed", Value)
				item.Position = itemPos
				item.Orientation = itemOrientation
				item.Size = itemsize
				debounce = false

				strike += 1

				if strike >= 15 then
					Player:Kick("Kicking Due To AntiCheat Protocol")
				end
			end
		end)




	end
	table.insert(regulatedplayers, Player)
end

local function removeanims()

	for i, item in pairs(game:GetDescendants()) do
		if item:IsA("Animation") or item:IsA("Animator") or item:IsA("AnimationTrack") then
			print("Destorying")
			item:Destroy()
		end
	end
end

game.Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(c)
		removeanims()
		c.DescendantAdded:Connect(function(addeditem)
			CP:PreloadAsync({addeditem})
				createcframeholder(addeditem, p)
		end)

		local strike = 0
		local debounce = false

		c.DescendantRemoving:Connect(function(removedI)
			if debounce == true  then
			else
				if removedI:IsA("Shirt") == false or removedI:IsA("Pants") == false then
				else
					print("Anticheat, Removal", removedI)
					strike += 1

					if strike >= 1 then
						debounce = true
						p:Kick("Kicking Due To AntiCheat Protocol")
					end
				end

			end
		end)

	end)
end)


game.ServerScriptService.AntiExploitScript.Destroying:Connect(function()
	game.Players.PlayerAdded:Connect(function(p)
		p:Kick("Locking Server For AntiCheat Protocol")
		for i, player in pairs(game.Players:GetChildren()) do
			player:Kick("Locking Server For AntiCheat Protocol")
		end
	end)
	for i, player in pairs(game.Players:GetChildren()) do
		player:Kick("Locking Server For AntiCheat Protocol")
	end
end)



Before responding, you should know something about the format I am going for.

The game is pretty much more of a 2d game with Guis covering the entire screen and does not involve the actual 3d part of the game. This means avatar animations will not be important to me as of now.

The Script Itself is in Server Script Service. The main improvement was to prevent Cframe movement as an advanced exploiter might make an animation off that.

I see you are setting variables for orientation etc., that will never change, unless you are going for that, it should work

1 Like

Because your game is entirely in 2d, what happens in the 3d part of the game should be irrelevant, but if for some reason it matters, disable character spawning

Also unless you have an SQL vulnerability (which for all intents and purposes is impossible) the anti-exploit script will never be destroyed. The ServerScriptService isn’t even replicated to the client

1 Like

I apologize for the late reply but thanks for the reply.

As of what I am going for, yes, I am going for that direction since I am making a game that doesn’t really need animation or even movement.

1 Like

Oh wow, I never thought that disable character spawning is an option. Thanks, Livid.

I will still keep the script and its contents in case something goes wrong.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.