Players Freezing in the Air

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.

3 Likes

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.

I updated the post to say what I use currently.

for i,v in pairs(game.Players:GetPlayers()) do
	if v.Character.Torso.Anchored == true then
		print(v.Name.. " has won!")
	end
end

Try using this

How do you know if they’re freezing their client and not just anchoring their own Torso?

1 Like

I did some research and found out how they do it.

Right-clicking and holding this bar will make the client freeze it looks like.

test

I don’t know how I would detect this though in a way that would receive less false-positives, while being sensitive enough to help.

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.

3 Likes

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.

Not sure but maybe using WindowFocused and WindowFocusReleased could work?

1 Like

It doesn’t seem like it will (at least from my experiments), but good thinking!

game:GetService('UserInputService').WindowFocused:Connect(function()
	print('focused')
end)

game:GetService('UserInputService').WindowFocusReleased:Connect(function()
	print('lost focus')
end)

I got a ‘focused’ on game start, but by doing the “exploit”, no “lost focus” was printed.

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.

Humanoid.FloorMaterial

1 Like

Thanks @uJordy haha was working on another project didn’t get the chance to find the Roblox wiki post

1 Like

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.

Check if the players client is Jumping for more than 3 seconds. You can use Humanoid.StateChanged() for this.

Thanks, this seems to work a lot better than the method I originally used.

Just out of interest, do you have any idea how they are freezing their client?

Are they using the behaviour when the graphics freezes when you resize/move the window? Or are they doing something more complicated?

Okay, I’m sorry I didn’t read that particular reply.

1 Like