How to tell if a resources is an anti-cheat scam

A lot of resources, especially in Resources/Community Resource, are scamming you on anti-cheat related resource. These resources usually require you to put some script into StarterPlayerScript and I guess, hopefully it work. This resource focus on how to detect those post as a scam that do nothing except for slowing down your player’s client.

Before Started, Remember:

  • Ignore any buzzwords by the author
  • Don’t trust any images by the author
  • Avoid putting scripts into your server. If it requires, always check it out yourself to avoid backdoor

Case Study

Code Reference Here

-- <RANDOM STARTING COMMENT STRIPED>
-- [Start of Codes]
if game:GetService("RunService"):IsStudio() then
    return
end
 
-- ratio stats:
-- avg 12.5, avg range 11.5-13.5, 98% ~17.5
-- awp averages about 31, so the difference is more than enough

-- we use a ratio so that slow pcs arent punished for being slow,
-- instead comparing execution time between a base test and getfenv

-- GETIMPORT gets slower after running getfenv, so this matters a lot
local getfenv = getfenv
local tick = tick

local violations = 0
while task.wait(0.2) do
    local t1 = tick()
    for i = 1, 1e4 do
        getfenv()
    end
    local t2 = tick()
    for i = 1, 1e4 do
        -- do nothing lol
    end
    local t3 = tick()
    local ratio = (t2-t1)/(t3-t2)
    if ratio > 25 then
        -- dont punish lag spikes, require 8 fails in a row
        violations = violations + 1
        if violations >= 8 then
            -- insert funny code here (while true do end, etc. etc.)
            warn("awp detected with decent confidence (r8: "..ratio.."), killing detection loop")
            break
        end
    else
        violations = 0
    end
end

Analysis:

-- ratio stats:
-- avg 12.5, avg range 11.5-13.5, 98% ~17.5
-- awp averages about 31, so the difference is more than enough
-- we use a ratio so that slow pcs arent punished for being slow,
-- instead comparing execution time between a base test and getfenv

Ignore the buzzwords, we don’t even know what you talking about when the code start with this random comments that let us think your so cool.

-- GETIMPORT gets slower after running getfenv, so this matters a lot
local getfenv = getfenv
local tick = tick

Unnecessary, but you called getfenv() so that is why, it stop optimization from the script, but the code causes all these

Code with analysis commented

local violations = 0
while task.wait(0.2) do
    local t1 = tick()
    for i = 1, 1e4 do -- 1e4 is 10,000, this keep doing getfenv() 10,000 times
        getfenv() -- spamming getfenv() without doing anything, this do absolutely nothing but lag your game
    end
    local t2 = tick()
    for i = 1, 1e4 do -- 1e4 is 10,000, this loop an empty block 10,000 times
        -- literally do nothing
    end
    local t3 = tick()
    local ratio = (t2-t1)/(t3-t2) -- How you get this formula?
    if ratio > 25 then
        -- "dont punish lag spikes, require 8 fails in a row", you are lagging the client, dude, you are the reason why
        violations = violations + 1
        if violations >= 8 then
            -- "insert funny code here (while true do end, etc. etc.)", summary: classic timing detection
            warn("awp detected with decent confidence (r8: "..ratio.."), killing detection loop") -- what can I say?
            break
        end
    else
        violations = 0
    end
end

Key Takeaway of This Scam

  • getfenv() disable optimization of the script, make it even easier for false positive, as documented in rfcs.luau.org
  • getfenv() is a heavy operation, spamming it 10,000 times lag your game, as documented in rfcs.luau.org
  • do nothing for 10,000 times
  • unknown/random timing formula to detect hack (timing detection most likely lead to false positive on low-ended devices)

TL; DR of this case

Spamming heavy operations to lag your game and introduce timing/game speed detection for false positive on low-ended devices

Summary of This Tutorial

  • Always analyze anti-cheat script before applying
  • Ignore buzzwords
  • Ignore false statement claimed by the author
  • Skip if you see any sort of timing detection, it is a scam
  • Never trust the author’s claim, verify the claim yourself
  • Client-Sided anti-cheat cannot stop advanced cheats, exploiters can just disable the script on the client
11 Likes

Not true, use of getfenv forces code to be in --!optimize 0, and the compiler doesn’t always “automatically” cache it for you (regardless of optimization mode), so in this specific case it’s not a buzzword, and it’s a correct use, luau.org is misleading as hell because it’s filled with… buzzwords.

In a script*


People who buy this slop honestly deserve it all Not defending this cope level “anti cheat”
No sane person who had spent at least 5 minutes doing research would’ve attempted to make a cope-level anti-cheat in a sandboxed language without direct access to memory.

3 Likes

The purpose of this post is to make sure no one actually trust them, including beginners. There is a lot in DevForum right now that Roblox totally don’t care about them scamming beginners, I can give some examples:

Thanks you for correcting, I admit I am not an expert on Luau, I just check it out and see that on line 133.

Corrected that typo

5 Likes

Then why would they even make the resource in the first place?

2 Likes

How I know, try to be popular in their dev forum profile by scamming beginners, I guess…

People are so desperate for lagging someone’s game :sob:

1 year old post and calling something that does what it says a scam is crazy

i had no performance hits running this and it did exactly what it said at the time

keep calling things buzzwords and disregarding the comments that explain it in detail (just because u dont understand it doesnt mean it means nothing :smiley:)

thank u

1 Like

Since this is about something that I contributed to, I suppose I’ll give some points in return

Ignore the buzzwords, we don’t even know what you talking about when the code start with this random comments that let us think your so cool.

These are not “buzzwords”, this is the explanation of what’s happening. The point of the script is to be a public resource, so of course I’m going to include the numbers behind it so people can actually verify and test the method themselves

Unnecessary, but you called getfenv() so that is why, it stop optimization from the script, but the code causes all these

As someone else mentioned above, localising getfenv does indeed matter, as getfenv getting called invalidates certain optimisations (e.g. FASTCALL and GETIMPORT), and for the purposes of what this serves, that difference is not negligible (though in most cases, this isn’t trivia you need to worry about)

getfenv itself is not a heavy operation, but rather it disables optimisations in the environment it was ran in. Considering this is being run entirely within its own localscript, that means it isn’t actually causing performance issues on the scale you imply. You can test this yourself right now - head into studio, make a script that calls getfenv 10000 times (hell, don’t even bother localising getfenv), and measure the os.clock() on both sides. I just did it, and the average was around 0.9ms (0.6ms with localising), which is notable but by no means a “heavy operation” that will cause insane lag on your game.

Skip if you see any sort of timing detection, it is a scam

A risky form of detection yes, but a scam? What’s the scam here? I allowed this to be released publicly, for free, with source code available, and no, I’m not selling anything extra on the side. I’m here to detail the fact that a certain executor was poorly made and therefore had a timing detection that a developer could use (as long as they test it properly) if they thought roblox moderation wasn’t catching enough by itself. There was even a disclaimer in the original post that you should extensively test any of those methods before considering actually deploying them. In what world is that a scam?

Never trust the author’s claim, verify the claim yourself

That’s why I provided the numbers that I did

Client-Sided anti-cheat cannot stop advanced cheats, exploiters can just disable the script on the client

This is a true point - anything where the server can have the authority is ideally better, but also having nothing on the client can be a waste of some good potential, since some things are out of scope for serverside protection

If you’d like me to explain how exactly this did work (AWP has since died so it won’t be of much use anymore) I can, though that might be a bit long (and probably not fit for this forum category?), so I can send that in private messages. But if you’re going to critique such a specific example to such an extent, at least do some testing with real code. Don’t just read up on if getfenv is laggy, go measure what the actual performance impact of running it 10000 times is

3 Likes

check that very very very long reply i made on that post

1 Like

So, if you don’t care about the official documentation in luau.org, don’t care about players on low-ended phone, have legit proof of those timing detection works. What can I say? Believe in what you believe in. This resources to designed to let beginners not fall for misconceptions of anti-cheat that actually slow their games down, please do not bring in a whole passage without proof to try attack my post, thanks. And I am not bringing anymore topics to try to defend myself, I know I am right.

Dont worry, we will be ignoring the buzzwords that aren’t “buzzwords” and just explain what the code is doing

You are so confidently wrong that it might start keeping me up at night

1 Like

Just because you don’t understand something, doesn’t mean it’s a scam??? you’re right that timing & memory detections should be ignored as they are unreliable and likely to false flag but other comments you made are scuffed. You don’t know what you’re talking about and I’m not falling for this ragebait post.

2 Likes