Advertisement
DaDogeDevelopment

Anti Cheat

Jun 13th, 2023 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. local maxFPS = 65 -- Maximum allowed FPS
  2.  
  3. function OnPlayerJoin(player)
  4. -- Initialize player-specific variables
  5. player.fpsCheck = false
  6. end
  7.  
  8. function OnPlayerUpdate(player)
  9. local fps = player:GetFPS()
  10.  
  11. if not player.fpsCheck then
  12. -- First frame check, record player's FPS
  13. player.fpsCheck = true
  14. player.initialFPS = fps
  15. elseif fps > maxFPS and player.initialFPS > maxFPS then
  16. -- Player's FPS exceeds the maximum allowed FPS
  17. player:Kick("System detecting that you are cheating")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement