Whitelisting Admins on an Anti-cheat

I have a server-side anti-cheat that checks on body scales and humanoid properties, using PlayerAdded and GetPropertyChangedSignal. It works alright so far.

However, it blocks changes from admins such as Adonis, the admin I used to test the script itself. I plan to extend the blocks to no-clipping, teleporting, and similar exploits, but I want the admin users in the game to still be able to use these.

As of the moment, I’m thinking about adding another array containing whitelisted users, but that would unnecessarily double the work.
What methods can I use to achieve the whitelist of legitimate admins? Or if possible, is there a way to yield an array from the existing admin module? I’d greatly appreciate any help.

1 Like

In the Anti-Cheat Script you should add a check. For example:

–if player was added and he’s body scale is not alright (he was probably cheating) we have to check first before rescaling them, or what your anti-cheat does, are they admins
if player.UserId ~= TypeAdminUserIdHere then
–rescale player here, run your anti-cheat here
end

1 Like

I have to admit, it really depends if it’s a Anti-Cheat out of toolbox or custom made.

I would suggest using

if player.UserId = 0 then
    return
else
    -- Code you want from the anti-exploit that can be bypassed by some players

    -- example
   
   if LocalPlayer.Walkspeed.Value >= 17 then

      LocalPlayer:Kick()
   end

end
2 Likes