Hello there fellow developer,
I am new to roblox dev forum and scripting. I have made this simple anti cheat script, but I am not satisfied with it. It has some lack of security. I want to improve it.
This script prevent hackers to:
- Fly
- Btools
- Have More Jump Power
- Have More Max Health
- God Mode
- Destroy The Script
This is the things that i want to improve:
- More Secure
- Doesnt Get Easily Bypassed
- Hard To Read
This is the first script.
local LocalPlayer = game:GetService("Players").LocalPlayer
repeat wait() until LocalPlayer
repeat wait() until LocalPlayer.Character
local Character = LocalPlayer.Character
local Backpack = LocalPlayer:WaitForChild("Backpack")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Anti = script.Parent:WaitForChild("Anti")
local Bodys = {
["BodyGyro"] = true,
["BodyPosition"] = true,
["Body Velocity"] = true
}
local Btools = {
["HopperBin"] = true,
}
while true do
--Anti Btools
Backpack.ChildAdded:Connect(function(Obj)
if Btools[Obj.ClassName] then
LocalPlayer.Character.Humanoid.Health = 0
end
end)
--Anti Fly
HumanoidRootPart.ChildAdded:Connect(function(Obj)
if Bodys[Obj.ClassName] then
LocalPlayer.Character.Humanoid.Health = 0
end
end)
--Anti FE God / Anti Humanoid Destroyer
Character.ChildRemoved:Connect(function(Obj)
if Obj:IsA("Humanoid") then
LocalPlayer.Character.Humanoid.Health = 0
end
end)
--Anti Jump Power
if LocalPlayer.Character:WaitForChild("Humanoid").JumpPower ~= 100 then
LocalPlayer.Character.Humanoid.Health = 0
end
--Anti Speed
if LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed ~= 100 then
LocalPlayer.Character.Humanoid.Health = 0
end
--Anti Max Health
if LocalPlayer.Character.Humanoid.MaxHealth ~= 100 then
LocalPlayer.Character.Humanoid.Health = 0
end
--Anti Disable / destroy
if not script.Parent:FindFirstChild("Anti") then
game:GetService("ReplicatedStorage"):FindFirstChild("Kick"):FireServer(function()
end)
elseif Anti.Disabled then
Anti.Disabled = false
end
wait(0.05)
end
Second script.
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Main = script.Parent:WaitForChild("Main")
while true do wait()
if not script.Parent:FindFirstChild("Main") then
game:GetService("ReplicatedStorage"):FindFirstChild("Kick"):FireServer(function()
end)
elseif Main.Disabled then
Main.Disabled = false
wait(0.05)
end
end
Third script
game:GetService("ReplicatedStorage"):FindFirstChild("Kick").OnServerEvent:Connect(function(player)
player:Kick("No Exploiting")
end)
Thank you for reading. Sorry if this is not appropriate to the topic. I am new to roblox dev forum. Any suggestion will be accepted.