Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1.  
  2. local gui_set = gui.SetValue;
  3. local gui_get = gui.GetValue;
  4. local frame_rate = 0.0
  5. local get_abs_fps = function()
  6. frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * globals.AbsoluteFrameTime()
  7. return math.floor((1.0 / frame_rate) + 0.5)
  8. end
  9.  
  10. function isFPSLow()
  11.  
  12. local w,h = draw.GetScreenSize();
  13. fps = get_abs_fps()
  14. if entities.GetLocalPlayer() ~= nil then
  15. if fps <= 80 then -- If fps is below 100 then it will turn adaptive hitboxes on and same if its above
  16. draw.Color(200, 0, 0, 255)
  17. draw.Text(w/w, (h/2), "Adaptive ON")
  18. AdaptiveHitBoxON();
  19. else
  20. draw.Color(0, 255, 0, 255)
  21. draw.Text(w/w, (h/2), "Adaptive OFF")
  22. AdaptiveHitBoxOFF();
  23. end
  24. end
  25. end
  26.  
  27. function AdaptiveHitBoxON()
  28.  
  29. gui_set("rbot_autosniper_hitbox_adaptive", 1);
  30.  
  31. end
  32.  
  33. function AdaptiveHitBoxOFF()
  34.  
  35. gui_set("rbot_autosniper_hitbox_adaptive", 0);
  36.  
  37. end
  38.  
  39. callbacks.Register( "Draw", "isFPSLow", isFPSLow);
  40. callbacks.Register( "Draw", "AdaptiveHitBoxOFF", AdaptiveHitBoxOFF);
  41. callbacks.Register( "Draw", "AdaptiveHitBoxON", AdaptiveHitBoxON);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement