Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------
- ----------- Update log -----------
- ----------------------------------------
- -- Update (20 Mar, 2019)
- -- Improved "Static" and "Jitter" anti-aim modes
- -- Improved freestanding for "No fake" anti-aim mode
- -- Update (19 Mar, 2019)
- -- Freestanding is now a separate option and works with all anti-aim modes (still requires Vector3.lua)
- -- Now using one key to switch sides instead of two (put hotkey style to "Toggle" to make manual anti-aim work properly)
- -- Implemented "Static body yaw" to work with "Static" and "Jitter" anti-aim modes (all credits go to abbie)
- -- Code improvements
- -- Update (16 Mar, 2019)
- -- Removed "Experimental" anti-aim style
- -- Added "No fake" anti-aim style
- -- Added "Freestanding" anti-aim style, based on "Static" anti-aim style (requires Vector3.lua - all credits go to Horse)
- -- Update (13 Mar, 2019)
- -- Changed behavior of "Experimental" anti-aim style (now works similar to Jitter)
- -- Changed combobox to multiselect for indicators (they now show your fake for both anti-aim styles)
- -- Recode (04 Mar, 2019)
- -- Added "Experimental" anti-aim style (most useful with scout)
- -- Removed two features: "On shot anti-aim fix", "Reposition indicators"
- -- Now using two different hotkeys to change sides of the anti-aim (if you want to use one key for both sides, set the first hotkey type to "On hotkey" and the second one to "Toggle")
- -- Indicators for "Static" anti-aim style show your fake angle; indicators for "Experimental" anti-aim style show your real angle
- -- Update (01 Mar, 2019)
- -- No longer using edge yaw in anti-aim list
- -- You are able to use "fake duck" by default, but enabling "on shot anti-aim" and "on shot fix" will cause automatic deactivation of this feature
- -- Credits: Horse, abbie, italian, duk
- ----------------------------------------
- ----------------------------------------
- ----------------------------------------
- require "Vector3"
- -- Local variables
- local client, ui, client_set_event_callback, client_get_cvar, client_draw_indicator, client_draw_text, client_screensize = client, ui, client.set_event_callback, client.get_cvar, client.draw_indicator, client.draw_text, client.screen_size
- local ui_get, ui_set, ui_set_visible, ui_ref = ui.get, ui.set, ui.set_visible, ui.reference
- local entity_get_local_player, entity_get_prop, entity_is_alive = entity.get_local_player, entity.get_prop, entity.is_alive
- enemyclosesttocrosshair = nil
- lowestfov = math.huge
- lowestdmg = math.huge
- -- Anti-aim references
- local pitch = ui_ref("AA", "Anti-aimbot angles", "Pitch")
- local base = ui_ref("AA", "Anti-aimbot angles", "Yaw base")
- local yaw, yaw_slider = ui_ref("AA", "Anti-aimbot angles", "Yaw")
- local yawjitter, yawjitter_slider = ui_ref("AA", "Anti-aimbot angles", "Yaw jitter")
- local bodyyaw, bodyyaw_slider = ui_ref("AA", "Anti-aimbot angles", "Body yaw")
- local limit = ui_ref("AA", "Anti-aimbot angles", "Fake yaw limit")
- local edgeyaw = ui_ref("AA", "Anti-aimbot angles", "Edge yaw")
- local freestanding = ui_ref("AA", "Anti-aimbot angles", "Freestanding")
- local twist = ui_ref("AA", "Anti-aimbot angles", "Twist")
- local lby = ui_ref("AA", "Anti-aimbot angles", "Lower body yaw")
- -- New UI elements
- local desync = ui.new_checkbox("AA", "Other", "Desync anti-aim")
- local color = ui.new_color_picker("AA", "Other", "Arrow color", 124, 195, 13, 220)
- local desyncstyle = ui.new_combobox("AA", "Other", "Desync mode", "Off", "Static", "Jitter", "No fake")
- local desynckey = ui.new_hotkey("AA", "Other", "Switch key")
- local indmulti = ui.new_multiselect("AA", "Other", "Anti-aim angle indicator", "Text", "Arrows")
- local autod = ui.new_checkbox("AA", "Other", "Freestanding")
- ui_set_visible(desynckey, false)
- ui_set_visible(indmulti, false)
- ui_set(yaw, "180")
- -- End of local variables
- -----------------------------------
- ---- Freestanding calculations ----
- -----------------------------------
- function Angle_Vector(angle_x, angle_y)
- sp, sy, cp, cy = nil
- sy = math.sin(math.rad(angle_y));
- cy = math.cos(math.rad(angle_y));
- sp = math.sin(math.rad(angle_x));
- cp = math.cos(math.rad(angle_x));
- return cp * cy, cp * sy, -sp;
- end
- function EnemyToCrosshair(index)
- fov = get_FOV(Vector3(client.camera_angles()), Vector3(client.eye_position()), Vector3(entity.hitbox_position(index, 0)))
- if(fov < lowestfov) then
- lowestfov = fov
- enemyclosesttocrosshair = index
- end
- end
- function CalcAngle(localplayerxpos, localplayerypos, enemyxpos, enemyypos)
- relativeyaw = math.atan( (localplayerypos - enemyypos) / (localplayerxpos - enemyxpos) )
- return relativeyaw * 180 / math.pi
- end
- function calculateBestAngle(enemy, ...)
- lx, ly, lz = entity_get_prop(entity_get_local_player(), "m_vecOrigin")
- viewangle_x, viewangle_y, roll = client.camera_angles()
- headx, heady, headz = entity.hitbox_position(entity_get_local_player(), 0)
- enemyx, enemyy, enemyz = entity_get_prop(enemy, "m_vecOrigin")
- mypos = Vector3(client.eye_position())
- bestangle = nil
- if(entity.is_alive(enemy)) then
- yaw = CalcAngle(lx, ly, enemyx, enemyy)
- for i,v in pairs({...}) do
- dir_x, dir_y, dir_z = Angle_Vector(0, (yaw + v))
- end_x = lx + dir_x * 55
- end_y = ly + dir_y * 55
- end_z = lz + 80
- index, damage = client.trace_bullet(enemy, enemyx, enemyy, enemyz + 70, end_x, end_y, end_z)
- index2, damage2 = client.trace_bullet(enemy, enemyx, enemyy, enemyz + 70, end_x + 12, end_y, end_z)
- index3, damage3 = client.trace_bullet(enemy, enemyx, enemyy, enemyz + 70, end_x - 12, end_y, end_z)
- if(damage < lowestdmg) then
- lowestdmg = damage
- if(damage2 > damage) then
- lowestdmg = damage2
- end
- if(damage3 > damage) then
- lowestdamage = damage3
- end
- if(lx - enemyx > 0) then
- bestangle = v
- else
- bestangle = v * -1
- end
- else if(damage == lowestdmg) then
- return 0
- end
- end
- end
- end
- return bestangle
- end
- -----------------------------------
- -----------------------------------
- -- UI elements on "Static" or "No fake" or "Jitter"
- local function combo()
- local enabled = ui_get(desync) and ui_get(desyncstyle) == "Static" or ui_get(desync) and ui_get(desyncstyle) == "No fake" or ui_get(desync) and ui_get(desyncstyle) == "Jitter"
- ui_set_visible(desynckey, enabled)
- ui_set_visible(indmulti, enabled)
- ui_set_visible(color, enabled)
- if ui_get(desyncstyle) == "Off" then
- ui_set(indmulti, "-")
- end
- end
- ui.set_callback(desyncstyle, combo)
- -- Multiselect table
- local function contains(table, val)
- for i=1, #table do
- if table[i] == val then
- return true
- end
- end
- return false
- end
- -- Manual anti-aims
- client_set_event_callback("paint", function()
- if not ui_get(desync) or ui_get(desyncstyle) == "Off" or entity_get_local_player() == nil or not entity_is_alive(entity_get_local_player()) then
- return
- end
- local value = ui_get(indmulti)
- if #value == 0 then
- return
- end
- local scrsize_x, scrsize_y = client_screensize()
- local center_x, center_y = scrsize_x / 2, scrsize_y / 2
- local ind_r, ind_g, ind_b, ind_a = ui_get(color)
- if ui_get(desyncstyle) == "Static" then
- if ui_get(desynckey) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-30")
- ui_set(yawjitter, "Offset")
- ui_set(yawjitter_slider, "0")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "-180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "LEFT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x - 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "◄")
- client_draw_text(c, center_x + 40, center_y, 255, 255, 255, 220, "c+", 0, "►")
- end
- else
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "8")
- ui_set(yawjitter, "Offset")
- ui_set(yawjitter_slider, "0")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "RIGHT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x + 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "►")
- client_draw_text(c, center_x - 40, center_y, 255, 255, 255, 220, "c+", 0, "◄")
- end
- end
- end
- if ui_get(desyncstyle) == "Jitter" then
- if ui_get(desynckey) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-33")
- ui_set(yawjitter, "Center")
- ui_set(yawjitter_slider, "3")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "-180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "LEFT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x - 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "◄")
- client_draw_text(c, center_x + 40, center_y, 255, 255, 255, 220, "c+", 0, "►")
- end
- else
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "8")
- ui_set(yawjitter, "Center")
- ui_set(yawjitter_slider, "-3")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "RIGHT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x + 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "►")
- client_draw_text(c, center_x - 40, center_y, 255, 255, 255, 220, "c+", 0, "◄")
- end
- end
- end
- if ui_get(desyncstyle) == "No fake" then
- if ui_get(desynckey) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-90")
- ui_set(yawjitter, "Off")
- ui_set(bodyyaw, "Off")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, false)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "LEFT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x - 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "◄")
- client_draw_text(c, center_x + 40, center_y, 255, 255, 255, 220, "c+", 0, "►")
- end
- else
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "90")
- ui_set(yawjitter, "Off")
- ui_set(bodyyaw, "Off")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, false)
- ui_set(lby, false)
- if contains(value, "Text") then
- client_draw_indicator(ctx, 124, 195, 13, 237, "RIGHT")
- end
- if contains(value, "Arrows") then
- client_draw_text(c, center_x + 40, center_y, ind_r, ind_g, ind_b, ind_a, "c+", 0, "►")
- client_draw_text(c, center_x - 40, center_y, 255, 255, 255, 220, "c+", 0, "◄")
- end
- end
- end
- end)
- -- Freestanding anti-aims
- client_set_event_callback("run_command", function()
- if not ui_get(desync) or ui_get(desyncstyle) == "Off" or entity_get_local_player() == nil or not entity_is_alive(entity_get_local_player()) then
- return
- end
- for i,v in pairs(entity.get_players(true)) do
- EnemyToCrosshair(v)
- end
- if ui_get(autod) then
- ui_set(indmulti, "-")
- ui_set_visible(desynckey, false)
- ui_set_visible(indmulti, false)
- ui_set_visible(color, false)
- if ui_get(desyncstyle) == "Static" then
- if (enemyclosesttocrosshair ~= nil) then
- yaw = calculateBestAngle(enemyclosesttocrosshair, -90, 90)
- if (yaw == -90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "8")
- ui_set(yawjitter, "Offset")
- ui_set(yawjitter_slider, "0")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- else if (yaw == 90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-30")
- ui_set(yawjitter, "Offset")
- ui_set(yawjitter_slider, "0")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "-180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- end
- end
- end
- end
- if ui_get(desyncstyle) == "Jitter" then
- if (enemyclosesttocrosshair ~= nil) then
- yaw = calculateBestAngle(enemyclosesttocrosshair, -90, 90)
- if (yaw == -90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "8")
- ui_set(yawjitter, "Center")
- ui_set(yawjitter_slider, "-3")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- else if (yaw == 90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-33")
- ui_set(yawjitter, "Center")
- ui_set(yawjitter_slider, "3")
- ui_set(bodyyaw, "Static")
- ui_set(bodyyaw_slider, "-180")
- ui_set(limit, "60")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, true)
- ui_set(lby, false)
- end
- end
- end
- end
- if ui_get(desyncstyle) == "No fake" then
- if (enemyclosesttocrosshair ~= nil) then
- yaw = calculateBestAngle(enemyclosesttocrosshair, -90, 90)
- if (yaw == -90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "-90")
- ui_set(yawjitter, "Off")
- ui_set(bodyyaw, "Off")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, false)
- ui_set(lby, false)
- else if (yaw == 90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "90")
- ui_set(yawjitter, "Off")
- ui_set(bodyyaw, "Off")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, false)
- ui_set(lby, false)
- else if not (yaw == 90) and not (yaw == -90) then
- ui_set(pitch, "Minimal")
- ui_set(base, "Local view")
- ui_set(yaw_slider, "0")
- ui_set(yawjitter, "Off")
- ui_set(bodyyaw, "Off")
- ui_set(edgeyaw, "Off")
- ui_set(freestanding, "-")
- ui_set(twist, false)
- ui_set(lby, false)
- end
- end
- end
- end
- end
- else
- ui_set_visible(desynckey, true)
- ui_set_visible(indmulti, true)
- ui_set_visible(color, true)
- end
- lowestfov = 999
- lowestdmg = 999
- end)
- -- Static body yaw
- client_set_event_callback("setup_command", function(cmd)
- if not ui_get(desync) or ui_get(desyncstyle) == "Off" or ui_get(desyncstyle) == "No fake" or entity_get_local_player() == nil or not entity_is_alive(entity_get_local_player()) then
- return
- end
- if cmd.in_jump ~= 0 then return end
- local sm = cmd.in_duck ~= 0 and 2.941177 or 1.000001
- sm = cmd.command_number % 4 < 2 and -sm or sm
- cmd.sidemove = cmd.sidemove ~= 0 and cmd.sidemove or sm
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement