Skip to content

Instantly share code, notes, and snippets.

@withs
Last active May 10, 2021 10:43
Show Gist options
  • Save withs/773b339df843ca9ae428d6f8d129d64b to your computer and use it in GitHub Desktop.
Save withs/773b339df843ca9ae428d6f8d129d64b to your computer and use it in GitHub Desktop.
crosshair indicators for Gamesense.pub
-- Shiba (8173)
local surface = require 'gamesense/surface'
local anti_aim = require 'gamesense/antiaim_funcs'
local screen_size = client.screen_size
local entity_get_prop = entity.get_prop
local entity_get_local_player = entity.get_local_player
local ui_get = ui.get
local ui_set = ui.set
local new_hotkey = ui.new_hotkey
local ui_new_label = ui.new_label
local ui_reference = ui.reference
local ui_new_slider = ui.new_slider
local ui_set_visible = ui.set_visible
local ui_new_checkbox = ui.new_checkbox
local ui_set_callback = ui.set_callback
local ui_new_multiselect = ui.new_multiselect
local ui_new_color_picker = ui.new_color_picker
local client_set_event_callback = client.set_event_callback
local client_unset_event_callback = client.unset_event_callback
local indics_checkbox = ui.new_checkbox("VISUALS", "Other ESP", "Enable crosshair indicators")
local indics_color_picker = ui_new_color_picker("VISUALS", "Other ESP", "Override toggled color", 255, 255, 255)
local indics_font_outline = ui_new_checkbox("VISUALS", "Other ESP", "Outline")
local indics_remove_base_indics = ui_new_checkbox("VISUALS", "Other ESP", "Remove other indicators")
local indics_pos_x_slider = ui_new_slider("VISUALS", "Other ESP", "Override x", -50, 100, 0, true, "px")
local indics_pos_z_slider = ui_new_slider("VISUALS", "Other ESP", "Override z", -50, 100, 0, true, "px")
local indics_sep = ui_new_slider("VISUALS", "Other ESP", "Override interlining", -50, 100, 0, true, "px")
local indics_font_size = ui_new_slider("VISUALS", "Other ESP", "Override Font size", 1, 100, 12, true, "px")
local indics_select = ui_new_multiselect("VISUALS", "Other ESP", "Desired indicators", "Fov", "Damage", "Legit AA", "Fake duck", "Force baim", "Double tap", "Freestanding","Automatic fire", "On shot anti-aim","Quick peek assist", "Force safe point", "Automatic penetration")
local indics_label_dt_color = ui_new_label("VISUALS", "Other ESP", "Loaded DT color")
local indics_color_dt = ui_new_color_picker("VISUALS", "Other ESP", "Loaded DT color", 255, 255, 255)
local indics_aa_arrows_checkbox = ui_new_checkbox("VISUALS", "Other ESP", "AA arrows")
local indics_aa_arrows_sep = ui_new_slider("VISUALS", "Other ESP", "Override x", -50, 100, 0, true, "px")
local indics_label_fake_r = ui_new_label("VISUALS", "Other ESP", "Override AA fake color")
local indics_color_fake_r = ui_new_color_picker("VISUALS", "Other ESP", "Override AA fake color", 255, 255, 255)
local indics_label_fake_l = ui_new_label("VISUALS", "Other ESP", "Override AA real color")
local indics_color_fake_l = ui_new_color_picker("VISUALS", "Other ESP", "Override AA real color", 255, 255, 255)
local indics_awallshot_toggle = ui.new_checkbox("VISUALS", "Other ESP", "Auto shoot & wall hotkey")
local ref_autoshoot = ui_reference("rage", "aimbot", "Automatic fire")
local ref_autoshoot_hotkey = new_hotkey("rage","aimbot", "Force automatic fire")
local ref_autowall = ui_reference("rage", "aimbot", "Automatic penetration")
local ref_autowall_hotkey = new_hotkey("rage","aimbot", "Force automatic penetration")
local font = surface.create_font("Verdana", ui_get(indics_font_size), 600, {0x000})
local font_arrow = surface.create_font("Verdana", 20, 700, {0x000})
local ref_fov = ui_reference("RAGE", "Aimbot", "Maximum fov")
local ref_aa_toggle = ui_reference("aa", "Anti-aimbot angles", "Enabled")
local ref_freestanding, ref_freestanding_hotkey = ui_reference("aa", "Anti-aimbot angles", "Freestanding")
local ref_min_damage = ui_reference("RAGE", "Aimbot", "Minimum damage")
local ref_force_safe_point_hotkey = ui_reference("RAGE", "Aimbot", "Force safe point")
local function is_nmcrhris_min_damage_lua()
is_exist = pcall(function() ui_reference("RAGE", "Other", "Override damage") end)
if is_exist then
return ui_reference("RAGE", "Other", "Override damage")
else
return nil
end
end
local min_dmg_override = is_nmcrhris_min_damage_lua()
local ref_duck = ui_reference("RAGE", "Other", "Duck peek assist")
local ref_baim = ui_reference("RAGE", "Other", "Force body aim")
local ref_dt, ref_dt_hotkey = ui_reference("RAGE", "Other", "Double tap")
local ref_quick_peek, ref_quick_peek_hotkey = ui_reference("RAGE", "Other", "Quick peek assist")
local ref_onshot_aa, ref_onshot_aa_hotkey = ui_reference("AA", "Other", "On shot anti-aim")
local ref_a_shoot = ui_reference("RAGE", "Aimbot", "Automatic fire")
local ref_a_wall = ui_reference("RAGE", "Aimbot", "Automatic penetration")
local indics_list = {}
ui_set_callback(indics_font_size, function(cmd)
if ui_get(indics_font_outline) then
font = surface.create_font("Verdana", ui_get(indics_font_size), 600, {0x200})
else
font = surface.create_font("Verdana", ui_get(indics_font_size), 600, {0x000})
end
end)
ui_set_callback(indics_font_outline, function(cmd)
if ui_get(indics_font_outline) then
font = surface.create_font("Verdana", ui_get(indics_font_size), 600, {0x200})
else
font = surface.create_font("Verdana", ui_get(indics_font_size), 600, {0x000})
end
end)
-- stolen
local function table_contains(tbl, val)
for i = 1, #tbl do
if tbl[i] == val then
return true
end
end
return false
end
-- end stolen
local function ui_visible()
if not ui_get(indics_checkbox) then
ui_set_visible(indics_pos_x_slider, false)
ui_set_visible(indics_pos_z_slider, false)
ui_set_visible(indics_sep, false)
ui_set_visible(indics_remove_base_indics, false)
ui_set_visible(indics_select, false)
ui_set_visible(indics_font_size, false)
ui_set_visible(indics_font_outline, false)
ui_set_visible(indics_label_fake_r, false)
ui_set_visible(indics_color_fake_r, false)
ui_set_visible(indics_label_fake_l, false)
ui_set_visible(indics_color_fake_l, false)
ui_set_visible(indics_aa_arrows_checkbox, false)
ui_set_visible(indics_aa_arrows_sep, false)
ui_set_visible(indics_color_picker, false)
ui_set_visible(indics_label_dt_color, false)
ui_set_visible(indics_color_dt, false)
ui_set_visible(ref_autoshoot_hotkey, false)
ui_set_visible(ref_autowall_hotkey, false)
ui_set_visible(indics_awallshot_toggle, false)
else
ui_set_visible(indics_pos_x_slider, true)
ui_set_visible(indics_pos_z_slider, true)
ui_set_visible(indics_sep, true)
ui_set_visible(indics_remove_base_indics, true)
ui_set_visible(indics_select, true)
ui_set_visible(indics_font_size, true)
ui_set_visible(indics_font_outline, true)
ui_set_visible(indics_color_picker, true)
ui_set_visible(indics_label_dt_color, true)
ui_set_visible(indics_color_dt, true)
ui_set_visible(indics_awallshot_toggle, true)
end
end
ui_visible()
ui_set_callback(indics_select, function(cmd)
if table_contains(ui_get(indics_select), "Legit AA") then
ui_set_visible(indics_label_fake_r, true)
ui_set_visible(indics_color_fake_r, true)
ui_set_visible(indics_label_fake_l, true)
ui_set_visible(indics_color_fake_l, true)
ui_set_visible(indics_aa_arrows_checkbox, true)
else
ui_set_visible(indics_label_fake_r, false)
ui_set_visible(indics_color_fake_r, false)
ui_set_visible(indics_label_fake_l, false)
ui_set_visible(indics_color_fake_l, false)
ui_set_visible(indics_aa_arrows_checkbox, false)
ui_set(indics_aa_arrows_checkbox, false)
end
end)
ui_set_callback(indics_checkbox, function(cmd)
ui_visible()
end)
ui_set_callback(indics_awallshot_toggle, function(cmd)
if ui_get(indics_awallshot_toggle) then
ui_set_visible(ref_autoshoot_hotkey, true)
ui_set_visible(ref_autowall_hotkey, true)
else
ui_set_visible(ref_autoshoot_hotkey, false)
ui_set_visible(ref_autowall_hotkey, false)
end
end)
ui_set_callback(indics_aa_arrows_checkbox, function(cmd)
if ui_get(indics_aa_arrows_checkbox) then
ui_set_visible(indics_aa_arrows_sep, true)
else
ui_set_visible(indics_aa_arrows_sep, false)
end
end)
ui_set_callback(indics_remove_base_indics, function(cmd)
if ui_get(indics_remove_base_indics) then
client_set_event_callback('indicator', function()
return
end)
else
client_unset_event_callback('indicator', function()
return
end)
end
end)
local function on_paint()
local base_color_r, base_color_g, base_color_b, base_color_a = ui_get(indics_color_picker)
local base_test_x, base_test_Z = client.screen_size()
base_test_x = ((base_test_x / 2) + 5)
base_test_z = ((base_test_Z / 2) + 15)
base_sep = 15 + ui_get(indics_sep)
if table_contains(ui_get(indics_select), "Fov") then
local a = {
name = "fov",
value = string.format("Fov: %g°", ui_get(ref_fov)),
color = {r = 255, g = 255, b = 255},
}
table.insert(indics_list, a)
end
if min_dmg_override == nil then
if table_contains(ui_get(indics_select), "Damage") then
a = {
name = "dmg",
value = string.format("Damage: %g", ui_get(ref_min_damage)),
color = {r = 255, g = 255, b = 255},
}
table.insert(indics_list, a)
end
else
if table_contains(ui_get(indics_select), "Damage") then
if ui_get(min_dmg_override) == ui_get(ref_min_damage) then
a = {
name = "dmg",
value = string.format("Damage: %g", ui_get(ref_min_damage)),
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
else
a = {
name = "dmg",
value = string.format("Damage: %g", ui_get(ref_min_damage)),
color = {r = 255, g = 255, b = 255},
}
table.insert(indics_list, a)
end
end
end
if table_contains(ui_get(indics_select), "Legit AA") and ui_get(ref_aa_toggle) then
local aa_color_l_r, aa_color_l_g, aa_color_l_b = ui_get(indics_color_fake_l)
local aa_color_r_r, aa_color_r_g, aa_color_r_b = ui_get(indics_color_fake_r)
local aa_sep = 50 + ui_get(indics_aa_arrows_sep)
if ui_get(indics_aa_arrows_checkbox) then
if tonumber(anti_aim.get_desync(1)) < 0 then
surface.draw_text(((base_test_x - 9) + aa_sep), (base_test_z - 27), aa_color_r_r, aa_color_r_g, aa_color_r_b, 255, font_arrow, "❯")
surface.draw_text(((base_test_x - 9) - aa_sep), (base_test_z - 27), aa_color_l_r, aa_color_l_g, aa_color_l_b, 255, font_arrow, "❮")
else
surface.draw_text(((base_test_x - 9) + aa_sep), (base_test_z - 27), aa_color_l_r, aa_color_l_g, aa_color_l_b, 255, font_arrow, "❯")
surface.draw_text(((base_test_x - 9) - aa_sep), (base_test_z - 27), aa_color_r_r, aa_color_r_g, aa_color_r_b, 255, font_arrow, "❮")
end
else
if tonumber(anti_aim.get_desync(1)) < 0 then
a = {
name = "laa",
value = "AA: Left",
color = {r = aa_color_l_r, g = aa_color_l_g, b = aa_color_l_b},
}
table.insert(indics_list, a)
else
a = {
name = "laa",
value = "AA: Right",
color = {r = aa_color_r_r, g = aa_color_r_g, b = aa_color_r_b},
}
table.insert(indics_list, a)
end
end
end
if table_contains(ui_get(indics_select), "Fake duck") then
if ui_get(ref_duck) then
a = {
name = "Fake duck",
value = "Fake duck",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Force baim") then
if ui_get(ref_baim) then
a = {
name = "Force baim",
value = "Force baim",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Double tap") then
local color_r, color_g, color_b = ui_get(indics_color_dt)
if ui_get(ref_dt_hotkey) and ui_get(ref_dt) then
if anti_aim.get_double_tap() then
a = {
name = "Double tap",
value = "Double tap",
color = {r = color_r, g = color_g, b = color_b},
}
table.insert(indics_list, a)
else
a = {
name = "Double tap",
value = "Double tap",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
end
if table_contains(ui_get(indics_select), "Quick peek assist") then
if ui_get(ref_quick_peek_hotkey) and ui_get(ref_quick_peek) then
a = {
name = "Quick peek assist",
value = "Quick peek assist",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Freestanding") then
if ui_get(ref_freestanding_hotkey) and ui_get(ref_freestanding) then
a = {
name = "Freestanding",
value = "Freestanding",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "On shot anti-aim") then
if ui_get(ref_onshot_aa_hotkey) and ui_get(ref_onshot_aa) then
a = {
name = "On shot anti-aim",
value = "On shot anti-aim",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Force safe point") then
if ui_get(ref_force_safe_point_hotkey) then
a = {
name = "Force safe point",
value = "Force safe point",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Automatic fire") then
if ui_get(ref_a_shoot) then
a = {
name = "ashoot",
value = "Automatic fire",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
if table_contains(ui_get(indics_select), "Automatic penetration") then
if ui_get(ref_a_wall) then
a = {
name = "awall",
value = "Automatic Penetration",
color = {r = base_color_r, g = base_color_g, b = base_color_b},
}
table.insert(indics_list, a)
end
end
local base_test_z_tmp = base_test_z + ui_get(indics_pos_z_slider)
local base_test_x_tmp = base_test_x + ui_get(indics_pos_x_slider)
for index, value in pairs(indics_list) do
surface.draw_text(base_test_x_tmp, base_test_z_tmp, value.color.r, value.color.g, value.color.b, base_color_a, font, value.value)
base_test_z_tmp = base_test_z_tmp + base_sep
end
indics_list = {}
end
client_set_event_callback('paint_ui', function()
if ui_get(ref_autoshoot_hotkey) then
ui_set(ref_autoshoot, true)
else
ui_set(ref_autoshoot, false)
end
if ui_get(ref_autowall_hotkey) then
ui_set(ref_autowall, true)
else
ui_set(ref_autowall, false)
end
if ui_get(indics_checkbox) then
if entity_get_prop(entity_get_local_player(), "m_lifeState") == 0 then
on_paint()
end
end
end)
@withs
Copy link
Author

withs commented May 2, 2021

[02/05/2021] Update :

  • Added Force safe point indicator
  • Added Freestanding indicator

@withs
Copy link
Author

withs commented May 10, 2021

[10/05/2021] Update :

  • fixed issue when the user don't use nmchris min damage lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment