Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gui_set = gui.SetValue;
- local gui_get = gui.GetValue;
- local frame_rate = 0.0
- local get_abs_fps = function()
- frame_rate = 0.9 * frame_rate + (1.0 - 0.9) * globals.AbsoluteFrameTime()
- return math.floor((1.0 / frame_rate) + 0.5)
- end
- function isFPSLow()
- local w,h = draw.GetScreenSize();
- fps = get_abs_fps()
- if entities.GetLocalPlayer() ~= nil then
- if fps <= 80 then -- If fps is below 100 then it will turn adaptive hitboxes on and same if its above
- draw.Color(200, 0, 0, 255)
- draw.Text(w/w, (h/2), "Adaptive ON")
- AdaptiveHitBoxON();
- else
- draw.Color(0, 255, 0, 255)
- draw.Text(w/w, (h/2), "Adaptive OFF")
- AdaptiveHitBoxOFF();
- end
- end
- end
- function AdaptiveHitBoxON()
- gui_set("rbot_autosniper_hitbox_adaptive", 1);
- end
- function AdaptiveHitBoxOFF()
- gui_set("rbot_autosniper_hitbox_adaptive", 0);
- end
- callbacks.Register( "Draw", "isFPSLow", isFPSLow);
- callbacks.Register( "Draw", "AdaptiveHitBoxOFF", AdaptiveHitBoxOFF);
- callbacks.Register( "Draw", "AdaptiveHitBoxON", AdaptiveHitBoxON);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement