Developing an Anti Exploit script, with these specific antis.
Would love all kinds of corrections.
----------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------CONFIGURATION-------------------------------------------------------------
local AllowedItems = {
["Item1"] = true; -- Edit Item1 name and so for the others below
["Item2"] = true;
["Item3"] = true
}
local GroupID = 123 -- Edit this to your GroupID
local GroupRank = 1 -- Edit this to the Group rank you would like to whitelist (All ranks above this will also be whitelisted)
local Max_Health = 100 -- Edit to the max health
local Max_Speed = 16 -- Edit to the max speed
---------------------------------End Of Configuration, please whitelist group again in the config section of the next script------------------
----------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------FEATURES-------------------------------------------------------------------
local Anti_Fly = true
local Anti_Health = true
local Anti_Humanoid_Destroyer = true
local Anti_Lightning = true
local Anti_PartInsertor = true
local Anti_Speed = true
local Anti_Teleportation = true
local Backpack_Control = true
----------------------------------------------------------END OF CONFIGURATION AND FEATURES----------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
local Players = game:GetService("Players")
local LocalPlayer = game.Players.LocalPlayer
local Character = LocalPlayer.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Backpack = LocalPlayer:WaitForChild("Backpack")
local NoDisabling = script.Parent:WaitForChild("NoDisabling")
repeat wait() until LocalPlayer
repeat wait() until LocalPlayer.Character
local Body = {
["BodyVelocity"] = true;
["BodyGyro"] = true;
["BodyPosition"] = true
}
local Parts = {
["Part"] = true;
["Model"] = true;
["MeshPart"] = true
}
--No Speed
if Anti_Speed == true then
if Character.Humanoid.WalkSpeed > Max_Speed then
LocalPlayer:Kick("No Exploit")
end
end
-- Anti part inserton
if Anti_PartInsertor == true then
game.Workspace.ChildAdded:Connect(function(Obj)
if Parts[Obj.ClassName] then
Obj:Destroy()
end
end)
end
-- Anti Lightning
if Anti_Lightning == true then
game.Lighting.ChildAdded:Connect(function(Obj)
if Obj:IsA("Sky") then
Obj:Destroy()
end
end)
end
-- Backpack Control
if Backpack_Control == true then
Backpack.ChildAdded:Connect(function(Obj)
if Obj:IsA("HopperBin") or not Obj:IsA(AllowedItems) then
LocalPlayer:Kick("No Exploiting")
end
end)
end
-- Anti Fly
if Anti_Fly == true then
HRP.ChildAdded:Connect(function(Obj)
if Body[Obj.ClassName] then
LocalPlayer:Kick("No Exploiting")
end
end)
end
-- Anti Humanoid Destroyer
if Anti_Humanoid_Destroyer == true then
Character.ChildRemoved:Connect(function(Obj)
if Obj:IsA("Humanoid") then
LocalPlayer:Kick("No Exploits")
end
end)
end
-- Anti Health
if Anti_Health == true then
if Character.Humanoid.Health > Max_Health then
LocalPlayer:Kick("No Exploits")
end
end
--Anti Teleportation
local PreviousPosition
if Anti_Teleportation == true then
function NoTeleport()
if HRP == nil then
LocalPlayer:Kick("No Exploits")
end
local PositionFirst = HRP.Position
delay(1, function()
local PositionSecond = HRP.Position
if(PositionSecond - PositionFirst).magnitude >= 140 then
LocalPlayer:Kick("No Exploits")
end
end)
end
end
local Player = game.Players:GetPlayers()
while wait() do
if LocalPlayer:GetRankInGroup(GroupID) >= GroupRank then
script.Disabled = true
elseif NoDisabling.Disabled then
NoDisabling.Disabled = false
elseif script.Parent:FindFirstChild("RealAnti") == nil then
LocalPlayer:Kick("Nope")
end
NoTeleport()
end