My game has been the target of fly exploits recently. From what I have seen from players reporting kids doing it, it hasn’t been the worst, albeit the exploiters can fly across the map and kill players from angles that make it hard to counter them.
I’m currently working on an anti-exploit system for this, however, I don’t know how to make it fool-proof. It seems the only way I can get it to work is to have it detect when a player inserts BodyGyro or something similar into their character from the client, however, an exploiter can delete this script.
I tried the following in a server script located inside the Character via StarterCharacterScripts:
local char = script.Parent
function checkIfBody(part) --- this checks for it being inserted into a character part.
--- my game has vehicles and what not in it, so I don't want it to trip
--- when a player could simply just be using a vehicle.
local result = false
local parts = {
"Head",
"HumanoidRootPart",
"Left Arm",
"Left Leg",
"Right Arm",
"Right Leg",
"Torso",
}
for list,names in pairs(parts) do
if part.Name == names then
result = true
end
end
return result
end
char.DescendantAdded:Connect(function(new)
local hum = char:WaitForChild("Humanoid",10)
if new:IsA("BodyGyro") then
if checkIfBody(new.Parent) == true then
if plr:GetRankInGroup(1049814) < 201 then --- moderators in my game are allowed to fly because they have admin commands
potentialExploiter(plr,"possibly using fly exploits.")
--- above line works. i am simply trying to log potential exploits before i utilize this script for punishment
end
end
end
end)
This above code does not activate when a player inserts BodyGyro into their character part. I had a staff member of mine help me test, as I don’t use exploits myself nor want to.
This script, inserted into PlayerGui, worked.
local Character = LocalPlayer.Character
Character.DescendantAdded:Connect(function(new)
local hum = Character:WaitForChild("Humanoid",10)
if new:IsA("BodyGyro") then
if checkIfBody(new.Parent) == true then
if LocalPlayer:GetRankInGroup(1049814) < 201 then
print(LocalPlayer.Name.." is exploiting!!!")
warn(LocalPlayer.Name.." is exploiting!!!")
print(LocalPlayer.Name.." is exploiting!!!")
warn(LocalPlayer.Name.." is exploiting!!!")
print(LocalPlayer.Name.." is exploiting!!!")
warn(LocalPlayer.Name.." is exploiting!!!")
--- spam that message a few times so its easy for my helper to see it
end
end
end
end)
How would I be able to detect players using fly exploits without them being able to delete the script does so? I’m pretty sure the options for the server to detect client behavior are very limited if not impossible, but detecting on the client itself isn’t reliable either due to them being able to delete it.