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.
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.
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.
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.
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.