Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local type=type;local setmetatable=setmetatable;local tostring=tostring;local a=math.pi;local b=math.min;local c=math.max;local d=math.deg;local e=math.rad;local f=math.sqrt;local g=math.sin;local h=math.cos;local i=math.atan;local j=math.acos;local k=math.fmod;local l={}l.__index=l;function Vector3(m,n,o)if type(m)~="number"then m=0.0 end;if type(n)~="number"then n=0.0 end;if type(o)~="number"then o=0.0 end;m=m or 0.0;n=n or 0.0;o=o or 0.0;return setmetatable({x=m,y=n,z=o},l)end;function l.__eq(p,q)return p.x==q.x and p.y==q.y and p.z==q.z end;function l.__unm(p)return Vector3(-p.x,-p.y,-p.z)end;function l.__add(p,q)local r=type(p)local s=type(q)if r=="table"and s=="table"then return Vector3(p.x+q.x,p.y+q.y,p.z+q.z)elseif r=="table"and s=="number"then return Vector3(p.x+q,p.y+q,p.z+q)elseif r=="number"and s=="table"then return Vector3(p+q.x,p+q.y,p+q.z)end end;function l.__sub(p,q)local r=type(p)local s=type(q)if r=="table"and s=="table"then return Vector3(p.x-q.x,p.y-q.y,p.z-q.z)elseif r=="table"and s=="number"then return Vector3(p.x-q,p.y-q,p.z-q)elseif r=="number"and s=="table"then return Vector3(p-q.x,p-q.y,p-q.z)end end;function l.__mul(p,q)local r=type(p)local s=type(q)if r=="table"and s=="table"then return Vector3(p.x*q.x,p.y*q.y,p.z*q.z)elseif r=="table"and s=="number"then return Vector3(p.x*q,p.y*q,p.z*q)elseif r=="number"and s=="table"then return Vector3(p*q.x,p*q.y,p*q.z)end end;function l.__div(p,q)local r=type(p)local s=type(q)if r=="table"and s=="table"then return Vector3(p.x/q.x,p.y/q.y,p.z/q.z)elseif r=="table"and s=="number"then return Vector3(p.x/q,p.y/q,p.z/q)elseif r=="number"and s=="table"then return Vector3(p/q.x,p/q.y,p/q.z)end end;function l.__tostring(p)return"( "..p.x..", "..p.y..", "..p.z.." )"end;function l:clear()self.x=0.0;self.y=0.0;self.z=0.0 end;function l:unpack()return self.x,self.y,self.z end;function l:length_2d_sqr()return self.x*self.x+self.y*self.y end;function l:length_sqr()return self.x*self.x+self.y*self.y+self.z*self.z end;function l:length_2d()return f(self:length_2d_sqr())end;function l:length()return f(self:length_sqr())end;function l:dot(t)return self.x*t.x+self.y*t.y+self.z*t.z end;function l:cross(t)return Vector3(self.y*t.z-self.z*t.y,self.z*t.x-self.x*t.z,self.x*t.y-self.y*t.x)end;function l:dist_to(t)return(t-self):length()end;function l:is_zero(u)u=u or 0.001;if self.x<u and self.x>-u and self.y<u and self.y>-u and self.z<u and self.z>-u then return true end;return false end;function l:normalize()local v=self:length()if v<=0.0 then return 0.0 end;self.x=self.x/v;self.y=self.y/v;self.z=self.z/v;return v end;function l:normalize_no_len()local v=self:length()if v<=0.0 then return end;self.x=self.x/v;self.y=self.y/v;self.z=self.z/v end;function l:normalized()local v=self:length()if v<=0.0 then return Vector3()end;return Vector3(self.x/v,self.y/v,self.z/v)end;function clamp(w,x,y)if w<x then return x elseif w>y then return y end;return w end;function normalize_angle(z)local A;local B;B=tostring(z)if B=="nan"or B=="inf"then return 0.0 end;if z>=-180.0 and z<=180.0 then return z end;A=k(k(z+360.0,360.0),360.0)if A>180.0 then A=A-360.0 end;return A end;function vector_to_angle(C)local v;local D;local E;v=C:length()if v>0.0 then D=d(i(-C.z,v))E=d(i(C.y,C.x))else if C.x>0.0 then D=270.0 else D=90.0 end;E=0.0 end;return Vector3(D,E,0.0)end;function angle_forward(z)local F=g(e(z.x))local G=h(e(z.x))local H=g(e(z.y))local I=h(e(z.y))return Vector3(G*I,G*H,-F)end;function angle_right(z)local F=g(e(z.x))local G=h(e(z.x))local H=g(e(z.y))local I=h(e(z.y))local J=g(e(z.z))local K=h(e(z.z))return Vector3(-1.0*J*F*I+-1.0*K*-H,-1.0*J*F*H+-1.0*K*I,-1.0*J*G)end;function angle_up(z)local F=g(e(z.x))local G=h(e(z.x))local H=g(e(z.y))local I=h(e(z.y))local J=g(e(z.z))local K=h(e(z.z))return Vector3(K*F*I+-J*-H,K*F*H+-J*I,K*G)end;function get_FOV(L,M,N)local O;local P;local Q;local R;P=angle_forward(L)Q=(N-M):normalized()R=j(P:dot(Q)/Q:length())return c(0.0,d(R))end
- local ui_set_visible, globals_absoluteframetime, globals_frametime, globals_tickinterval, get_prop, ui_get, sqrt, sin, cos, get_local_player, get_all_players, get_player_name, get_screen_size, draw_text, client_console_cmd, client_delay_call, get_player_name, get_classname, get_local_player, globals_realtime, globals_tickcount = ui.set_visible, globals.absoluteframetime, globals.frametime, globals.tickinterval, entity.get_prop, ui.get, math.sqrt, math.sin, math.cos, entity.get_local_player, entity.get_players, entity.get_player_name, client.screen_size, client.draw_text, client.exec, client.delay_call, entity.get_player_name, entity.get_classname, entity.get_local_player, globals.realtime, globals.tickcount
- local table_insert, table_remove, math_floor, math_sqrt, math_min, math_abs = table.insert, table.remove, math.floor, math.sqrt, math.min, math.abs
- local entity_is_enemy, entity_is_alive, entity_is_dormant = entity.is_enemy, entity.is_alive, entity.is_dormant
- local ui_new_checkbox, ui_new_slider, ui_new_combobox, ui_new_multiselect = ui.new_checkbox, ui.new_slider, ui.new_combobox, ui.new_multiselect
- local getvar, setvar = client.get_cvar, client.set_cvar
- local ui_set, ui_ref, c_event_cb, ui_cb, ui_color_picker = ui.set, ui.reference, client.set_event_callback, ui.set_callback, ui.new_color_picker
- local ui_set_callback, ui_set_visible, globals_absoluteframetime, globals_frametime, globals_tickinterval, get_prop, ui_get, sqrt, sin, cos, get_local_player, get_all_players, get_player_name, get_screen_size, draw_text, client_console_cmd, client_delay_call, get_player_name, get_classname, get_local_player, globals_realtime, globals_tickcount = ui.set_callback, ui.set_visible, globals.absoluteframetime, globals.frametime, globals.tickinterval, entity.get_prop, ui.get, math.sqrt, math.sin, math.cos, entity.get_local_player, entity.get_players, entity.get_player_name, client.screen_size, client.draw_text, client.exec, client.delay_call, entity.get_player_name, entity.get_classname, entity.get_local_player, globals.realtime, globals.tickcount
- local table_insert, table_remove, math_floor, math_sqrt, math_min, math_abs = table.insert, table.remove, math.floor, math.sqrt, math.min, math.abs
- local entity_is_enemy, entity_is_alive, entity_is_dormant = entity.is_enemy, entity.is_alive, entity.is_dormant
- local ui_new_checkbox, ui_new_slider, ui_new_combobox, ui_new_multiselect = ui.new_checkbox, ui.new_slider, ui.new_combobox, ui.new_multiselect
- local getvar, setvar = client.get_cvar, client.set_cvar
- local body_aim = ui_new_checkbox("LUA", "A", "Bodyaim if lethal")
- local body_aim_indic = ui_new_checkbox("LUA", "A", "Bodyaim indicator")
- local body_aim_logs = ui_new_checkbox("LUA", "A", "Bodyaim logs")
- local body_aim_hp = ui_new_slider("LUA", "A", "Bodyaim if hp is less then", 0, 100)
- local ba_md_def_m = ui_new_combobox("LUA", "A", "Default bodyaim mode", "Off", "Always on", "Moving targets", "Aggressive", "High inaccuracy")
- local ba_md_op = ui_new_checkbox("LUA", "A", "Bodyaim damage optimization")
- local ba_md_def_e = ui_new_slider("LUA", "A", "BDO enables at ", 0, 100, 20, true, "hp")
- local ba_md_def = ui_new_slider("LUA", "A", "BDO default damage", 0, 106)
- local ref_target_hitbox = ui.reference("rage", "aimbot", "target hitbox")
- local ref_bodyaim = ui.reference("Rage", "Other", "Prefer body aim")
- local r_mindmg = ui.reference("Rage", "Aimbot", "Minimum damage")
- local is_baiming = false
- local bdo_active = false
- local function runMenuThings()
- ui_set_visible(body_aim_hp, ui_get(body_aim))
- ui_set_visible(body_aim_logs, ui_get(body_aim))
- ui_set_visible(body_aim_indic, ui_get(body_aim))
- ui_set_visible(ba_md_def_m, ui_get(body_aim))
- ui_set_visible(ba_md_def, ui_get(ba_md_op))
- ui_set_visible(ba_md_def_e, ui_get(ba_md_op))
- end
- runMenuThings()
- local function enable_baim()
- local hitboxes = ui_get(ref_target_hitbox)
- for i=1, #hitboxes do
- if hitboxes[i] == "Head" then
- table_remove(hitboxes, i)
- break
- end
- end
- is_baiming = true
- if ui_get(body_aim_logs) then
- client.log("Succesfully enabled baim")
- end
- ui.set(ref_target_hitbox, hitboxes)
- end
- local function disable_baim()
- local hitboxes = ui_get(ref_target_hitbox)
- table_insert(hitboxes, "Head")
- if ui_get(body_aim_logs) then
- client.log("Succesfully disabled baim")
- end
- is_baiming = false
- ui.set(ref_target_hitbox, hitboxes)
- ui.set(ref_bodyaim, ui_get(ba_md_def_m))
- end
- local function run_cmd()
- if (ui_get(body_aim)) then
- local local_player = get_local_player()
- if local_player == nil or not entity.is_alive(local_player) then
- return
- end
- local v_origin_local = Vector3(get_prop(local_player, "m_vecAbsOrigin"))
- if v_origin_local.x == nil then
- return
- end
- local players = get_all_players(true)
- local closestplayer = nil
- local pitch, yaw, roll = client.camera_angles()
- local cam_angle = Vector3(pitch, yaw, 0)
- local fov = 180 -- get all players and calc closest
- if ui_get(ba_md_op) then
- end
- for i=1, #players do
- local entindex = players[i]
- if entity_is_enemy(entindex) and entity_is_alive(entindex) and not entity_is_dormant(entindex) then
- local v_origin_enemy = Vector3(entity.get_prop(entindex, "m_vecOrigin"))
- local cur_fov = get_FOV(cam_angle, v_origin_local, v_origin_enemy)
- if cur_fov < fov then
- fov = cur_fov
- closestplayer = entindex
- end
- end
- end
- if closestplayer ~= nil then
- local localplayer = entity.get_local_player()
- local closestplayer_hp = entity.get_prop(closestplayer, "m_iHealth")
- if (closestplayer_hp <= ui_get(body_aim_hp)) then
- if ui_get(body_aim_logs) then
- client.log("Body aiming " .. entity.get_player_name(closestplayer) .. " - " .. closestplayer_hp)
- end
- if ui_get(ba_md_op) and closestplayer_hp <= ui_get(ba_md_def_e) then
- ui.set(r_mindmg, closestplayer_hp)
- bdo_active = true
- end
- enable_baim()
- else
- --ui.set(ref_bodyaim, "On hotkey") --doesnt work cuz idk
- ui.set(r_mindmg, ui_get(ba_md_def))
- disable_baim()
- end
- else
- if ui_get(ba_md_op) then
- ui.set(r_mindmg, ui_get(ba_md_def))
- end
- bdo_active = false
- disable_baim()
- end
- end
- end
- client.set_event_callback("paint", function()
- if (is_baiming) and ui_get(body_aim_indic) then
- renderer.indicator(140, 244, 66, 255, "BAIM")
- end
- if (bdo_active) and ui_get(body_aim_indic) and (is_baiming) then
- renderer.indicator(66, 134, 244, 255, "BDO Active")
- end
- end)
- ui.set_callback(body_aim, function()
- runMenuThings()
- end)
- ui.set_callback(ba_md_op, function()
- runMenuThings()
- end)
- client.set_event_callback("run_command", run_cmd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement