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.