local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid")
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if Humanoid.FloorMaterial == Enum.Material.Air then
warn("Suspicious act, possibly flying.")
end
end)
Which simply checks if the player stands in the air or anyother material [which helps to detect if they’re flying or something].
My Question is :
What if the player falls in the void?
[In my game, you can’t really fall to there, the map also has walls and invisible top, but let’s say they’re waiting/loading and somehow they glitched and fell into the void, how can I not false kick them ?]
Because this script can actually help detecting people who are flying/flinging, so I could kick them immediately. But what if [prob won’t happen, but what if], normal players are glitching and falling to void?
could maybe raycast downwards about 50000 studs, detect if there’s a part below the player. no parts can signify the player is falling into the void. add some other code that periodically checks the player’s position. a decreasing y value can signify the player is falling.
Also, is it possible that if the map is blocked and you basically cant really fall to void,
is it possible at any chance that the normal players would somehow glitch to void?
For starters you should not try anti cheats on local scripts. Hackers will simply delete any line that runs LocalPlayer:Kick(), they have full control over their computer.
Falling into the void will probably always look like flying (with downward momentum) so it is probably best to teleport the player back to spawn. If they are hacking then this will be annoying and prevent them from flying far. If they aren’t hacking then they will be saved and eternally grateful.
This happens only when there isn’t a spawnpoint or there is one but without a brick/any object above it.
So I am not worried about this one since my spawns are covered by objects above them.
True.
Luckily, exploiters from my community are skids who barely know how to hook or anything like that. So I am not worried much, I doubt they know how to do that.
Never rely on you thinking you know how smart exploiters are. Do your code on the server side, if your game grows to attract smart exploiters, it’s definitely gonna bite you later.