Anti Tab Glitch (server-sided | original release)

local Players = game:GetService("Players")


-- // Anti Tab Glitch
Players.PlayerAdded:Connect(function(Player: Player)
	Player.CharacterAdded:Connect(function(Character)
		local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
		
		local _L = coroutine.create(function()
			while task.wait() do
				local OldPosition = HumanoidRootPart.Position
				local OldVelocity = HumanoidRootPart.Velocity
				
				print(Player:GetNetworkPing() * 2000)
				task.wait(.15) -- // Amount of time allowed in air. (.15 works well)
				
				local CurrentPosition = HumanoidRootPart.Position
				local CurrentVelocity = HumanoidRootPart.Velocity 

				if OldPosition == CurrentPosition and OldVelocity ~= Vector3.new(0,0,0) and CurrentVelocity ~= Vector3.new(0,0,0) and tonumber(Player:GetNetworkPing() * 2000) < 200 then
					Player:Kick('Tab-Glitching')
				end
			end
		end)
		coroutine.resume(_L)
		
		-- // Prevent's kicking when player is dead.
		Character.Humanoid.Died:Connect(function()
			coroutine.close(_L)
		end)
	end)

end)


Anti-Tab Glitch, as far as I know I’m the first one to open source something like this.

If you don’t know what tab glitching Is, its when the player freezes them self by holding right click on the tab of the roblox client.
Anti-Tab-Glitch also counters for laggy players by not checking them if there ping is over 200ms.

  • Update 0.1
  • Fixed Kicking Player When Dead…

Without Anti-Tab-Glitch

With Anti-Tab-Glitch

54 Likes

First time seeing a glitch like that :open_mouth:

7 Likes

Its existed since the dawn of time on the Roblox client, and ROBLOX refuses to patch it (its really hard to patch, don’t blame them).
So I made my own patch.

4 Likes

I remember when in 2020 it was excessively used in Jailbreaks train robbedy

4 Likes

Will this also kick laggy players, as an added bonus?

3 Likes

As highlighted in the explanation.

Anti-Tab-Glitch also counters for laggy players by not checking them if there ping is over 200ms.

2 Likes

I guess that’s fine. If an exploiter was to bypass the ping check, they wouldn’t need the ‘tab glitch’ in the first place.

5 Likes

It’s a built-in for roblox, that has no bypass yet.

2 Likes

I personally don’t think you should kick them. Setting the network ownership of their character to the server is both funnier and guarantees that any false positives are completely harmless.

9 Likes

LoL Yeah, this is totally customizable

2 Likes

Fixed a death bug, that would cause the player to be kicked.

2 Likes

Really neat! Never knew that roblox had its own function to check a players ping, learned something new lol.

3 Likes

Came out recently,
read more here: Using :GetNetworkPing() to get players ping

2 Likes

Agreed, this is no module I plan on working on.
It was just a concept.

3 Likes

That might be an issue. I’ve commonly had my ping over 200ms in a 15-player server, and I don’t have relatively bad internet.

Though, this is a good anti-cheat system. I might use it in the future if I find players abusing it.

3 Likes

according to google sources over 140 MS is considered laggy.

You could also just remove it?
:man_shrugging:

3 Likes

Not in Roblox.

Yeah, but then it might trigger accidentally. I’m not really sure how to solve it, but you can simulate it with IncomingReplicationLag in studio settings to try and find a fix.

3 Likes

Just up it to 400 MS or 500 MS.

3 Likes

Try doing task.wait(Player:GetNetworkPing()) so that it will automatically adjust.

3 Likes

Always be recording the player’s ping, get the mean of the last X amount of ping ms’s, if the current ping differs by too much (aka: a spike) set ownership of the character to the server until the ping stabilizes.

6 Likes