Common Client-Server mistakes

tested, when anti-cheat compared 2 positions every 1/4 of second when i teleported player in 1/8 of second it didn’t fired

Could you please show me the teleport script and the anti-cheat?

-- Tp script, teleports player to position X and then quickly back.

-- Some trigger
local current = Character.PrimaryPart.Position
Character.PrimaryPart.Position = targetPosition -- let's say we want to tp player to coin and back to don't fire anti-cheat
task.wait(1/8)
Character.PrimaryPart.Position = current 

-- Anticheat, max distance is set in settings and given
local last = Character.PrimaryPart.Position
while true do
  local current = Character.PrimaryPart.Position
  if (current - last).Magnitude > MaxDistance then
    print("Player cheated: "..Character.Name)
  end
  
  last = current
  task.wait(1/4)
end

In this scenario, there is chance that coin collection will detect that player is near it and then player teleports back soo he can’t be caught

The problem is that you are checking every 1/4 seconds. An actual anti-cheat will only check every second.

You can whitelist server-sided teleports by listening to HumanoidRootPart:GetPropertyChangedSignal("CFrame") and setting the last CFrame to the new CFrame, this will not trigger upon client-sided teleports but will when a server-sided teleportation happens, letting your server-sided scripts teleport players without the anti cheat having a spasm.

1 Like

if there is 1 second of cooldown between checks, still player can teleport super fast and collect coins, then go back and never be caught

Thats just not how it works.

Then? how it works? if we have touched event or something to detect if player collected coins, 1/2 of second is enough to collect them and go back, also lerp teleport can bypass stuff

I don’t want to argue anymore, i know there can be good anti-cheat and made well can limit use of cheats, still for most of the games there are no need for anti-cheat as it doesn’t harm players, only gives cheater a slight advantage, even then there can be automation cheat that simply allows player to be afk and get items.

Still for me most of the time anti-cheat is useless or simply you don’t need that strong anti-cheat, safe remotes is the most important thing, thanks for discussion anyways

To also agree with you, i will say there are moments when anti-cheat is usefull and moments when it’s useless, bye

1 Like

I disagree in some cases you need to access the stamina on the server for things like stamina draining when you jump or a weapon being used,

this can be done via remotes., also jumping can be done client-side completely

1 Like

But what if someone drives a vechicle off a cliff or smth? kindof realistic maybe? ¯_(ツ)_/¯


True you helped me feel less lonely that I’m not the only one that knows about these comon mistakes a lot of people make! :D


Well then you have to rely on Byfron’s Hyperion, and players reporting exploiters. Which is okay, especialy if your just gonna make a single-player game or just a non-competitive game in general, but if your making a competitive game then, you should add anti-cheat, or server authoritive stuff like Chickynoid, or just any defense against exploiters.


So true especialy for someone with bad internet like me.


I’d also like to add:

6. Teleportation:

Remember when moving the Player’s Character you should do it client-side to make sure there’s no delay.
IDK what else to add

1 Like