Hi, I am currently working on a game (a minigames place). Some players seem to freeze in the air on purpose which allows them to win. Does anyone know how I would be able to detect these people so I can reset their characters?
Edit: To be more precise, I feel like this freezes the entire client. I currently have a RemoteFunction setup and if each client does not successfully send and receive a string every few seconds, I reset their character. Unfortunately, this seems to not be precise enough as a lot of people with bad internet connections seem to be getting false-positives. So essentially, I am wondering if there would be a better way to check for people who freeze their client.
Where are you doing these checks to see if the player is frozen in the air? Server or Client?
You could do a sanity check every few or so seconds to see if the player has actually moved.
If it helps, FPS calculated from workspace:GetRealPhysicsFPS() drops to around 16-17 when you are freezing. I don’t think this could be a valid solution as low-end devices would get false positives.
Just found out that by using the deltaTime on RunService.RenderStepped, the frames completely stop.
here’s some data that I got by printing out the dT
0.016068700700998 -- playing
0.014058699831367 -- playing
2.2175848484039 -- holding down freeze
0.0040815002284944 -- playing
0.014939500018954 -- playing
0.015316099859774 -- playing
You could do something like this:
game:GetService('RunService').RenderStepped:Connect(function(dt)
if dt > 1 then -- The game has been frozen for 1+ second
print('Cheating')
end
end)
But you may want to account for false-positives, or even join this with another method.
In addition to @OverHash, you should just do a load of sanity checks on both client and server to make your conclusions.
You could base it on a point system out of 5- if the player gets enough evidence to suggest that they’re cheating then deal with them or whatever.
If I recall correctly, you can find out what type of material the person is stepping on within the humanoid, you could check that a player has touched a material on the ground within X seconds, when floating/jumping this returns nil I believe.
I think the client-side FPS check is good enough. I don’t expect the FPS to drop to zero for ~10 straight seconds – even on low-end devices. Once you detect that the delta between the last frame and the current frame is too long, ping the server and have that player killed.
And before anyone whines that client-side checks suck, any hacker that can disable this client-side fps check can bypass it by just anchoring their character anyway.