Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local db = database.read('loader_hc') or {}
- local scripts_reloaded = true
- local get, set = ui.get, ui.set
- local get_prop = entity.get_prop
- --------------------------------------------------------------------------------
- -- Script functions
- --------------------------------------------------------------------------------
- local cache = { }
- local script = {
- variable = { '-', 'Automatic', 'Manual[beta]'},
- global_dtap = nil,
- var_cached = nil,
- active = false,
- time = -0.26,
- max_time = 0,
- }
- --------------------------------------------------------------------------------
- -- Menu functions
- --------------------------------------------------------------------------------
- local is_active = ui.new_checkbox('aa', 'other', 'Hitchance precision')
- local hitchance = ui.reference('rage', 'aimbot', 'minimum hit chance')
- local f_duck = ui.reference('rage', 'other', 'duck peek assist')
- local fake_lag_lim = ui.reference('aa', 'fake lag', 'limit')
- --------------------------------------------------------------------------------
- -- Function
- --------------------------------------------------------------------------------
- local function cache_process(condition, should_call, a, b)
- local name = tostring(condition)
- cache[name] = cache[name] ~= nil and cache[name] or get(condition)
- if should_call then
- if type(a) == "function" then a() else
- set(condition, a)
- end
- else
- if cache[name] ~= nil then
- if b ~= nil and type(b) == "function" then
- b(cache[name])
- else
- set(condition, cache[name])
- end
- cache[name] = nil
- end
- end
- end
- --------------------------------------------------------------------------------
- -- Callback
- --------------------------------------------------------------------------------
- client.set_event_callback("predict_command", function()
- script.time = -0.26
- local me = entity.get_local_player()
- local weapon = entity.get_player_weapon(me)
- script.var_cached = script.var_cached ~= nil and script.var_cached or get(fake_lag_lim)
- local m_flNextAttack = get_prop(me, "m_flNextAttack")
- local next_attack = get_prop(weapon, "m_flNextPrimaryAttack")
- if next_attack == nil then
- script.active = false
- return
- end
- local max_time = 0.69
- local current_time = globals.curtime()
- local m_flAttackTime = next_attack + 0.5
- local m_flNextAttack = m_flNextAttack + 0.5
- local shift_time = m_flAttackTime - current_time
- if m_flAttackTime < m_flNextAttack then
- max_time = 1.52
- shift_time = m_flNextAttack - current_time
- end
- script.time = shift_time
- script.max_time = max_time
- local is_safe = max_time ~= 1.52 and shift_time > 0.1
- local fd_active = get(f_duck)
- if fd_active then
- set(fake_lag_lim, 14)
- else
- if script.var_cached ~= nil then
- set(fake_lag_lim, script.var_cached)
- script.var_cached = nil
- end
- end
- if get(is_active) then
- local shots_fired = get_prop(me, "m_iShotsFired")
- cache_process(hitchance, is_safe and shots_fired > 0 and shift_time >= (max_time - 0.1), 0) ------------------
- end
- end)
- --------------------------------------------------------------------------------
- -- BD callback
- --------------------------------------------------------------------------------
- client.set_event_callback("paint_ui", function()
- if scripts_reloaded then
- set(is_active, db.is_active or false)
- scripts_reloaded = false
- else
- db.is_active = get(is_active)
- database.write('loader_hc', db)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement