Roblox made it so FloorMaterial doesnt replicate from the client to the server anymore so you can just check if the FloorMaterial is air for way too long.
But maybe Anti Exploit can detects when player is FreeFalling? also how can i do this?
Just make a time limit and if the player is in the air for over that time limit then they’ll be punished.
Just make a loop that runs when the player’s floor material is air and make it add 0.1 seconds to a counter and reset the counter when they’re not in the air and just check if the time limit is exceeded.
I’ll try that but what if player lagging?
Players can just teleport themselves back onto the ground at a random place, so this wouldnt help.
There’s this post:
that may help with what you’re trying to achieve.
What if players got fling? This script detecting players if they get fling.
Just make it so the anticheat is very passive and just teleports the player back to the floor.
You can just check if the floor material keeps changing from air to another part too fast and way too much to deal with that.
in some cases hackers may use body movers to move their characters, watch for those in characters.
Ah yes create a client sided anticheat!!! which they can just hook and make it return end or nil!!!
Ideally, you want any kind of AntiCheat system to be server side only. Do your detections there. If you put your AntiCheat on the client, you are essentially trusting the client to turn themselves in.
i did that but it’s always teleporting the players, when got fling while ragdolled or not
then check the amount of seconds they’re in the air and if they’re in the air for over a second then teleport them.
Jumping with the NORMAL Roblox jump height takes a little more than a second…
local character_cache = {}
game["Run Service"].Heartbeat:Connect(function()
local currentTime = os.clock()
local maxTimeInAir = 3 -- insert the duration here
for player : Player, cache in pairs(character_cache) do
if currentTime - cache[3] >= maxTimeInAir then
local human : Humanoid = cache[4]
if not table.find({Enum.HumanoidStateType.FallingDown,Enum.HumanoidStateType.Freefall},human:GetState()) then
-- PLAYER IS PROBABLY EXPLOITING
else
character_cache[player][3] = currentTime
end
end
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(character)
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if humanoid.FloorMaterial == Enum.Material.Air then
character_cache[plr] = {character, humanoid.FloorMaterial, os.clock(), humanoid}
else
character_cache[plr] = nil
end
end)
character.Destroying:Connect(function()
character_cache[plr] = nil
end)
end)
end)
edit: haven’t actually tested this but in theory it should work
Try using game:GetService("RunService")
instead, for cleaner (and maybe safer too) code.
No real performance difference between game[service] and game:GetService(“Service”)
server sided of course, that would be dumb. who said to use local scripts
I saw a script that searched for body gyros in the player character. but now I realised that the body gyro maybe not be replicated to the server…