Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local client_set_event_callback = client.set_event_callback
- local entity_get_local_player, entity_hitbox_position, entity_is_alive = entity.get_local_player, entity.hitbox_position, entity.is_alive
- local renderer_line, renderer_world_to_screen = renderer.line, renderer.world_to_screen
- local ui_get, ui_new_checkbox, ui_new_color_picker, ui_reference, ui_set_callback, ui_set_visible = ui.get, ui.new_checkbox, ui.new_color_picker, ui.reference, ui.set_callback, ui.set_visible
- -- Menu
- local menu = {
- draw_fake = ui_new_checkbox("AA", "Other", "Draw fake angles"),
- draw_fake_color = ui_new_color_picker("AA", "Other", "Fake color", 255, 255, 255, 255),
- }
- -- References
- local thirdperson, thirdperson_hotkey = ui_reference("VISUALS", "Effects", "Force third person (alive)")
- -- Variables
- local hitboxPos = {}
- local hitbox = {
- [0] = "head_0",
- [1] = "neck_0",
- [2] = "pelvis",
- [3] = "spine_0",
- [4] = "spine_1",
- [5] = "spine_2",
- [6] = "spine_3",
- [7] = "leg_upper_L",
- [8] = "leg_upper_R",
- [9] = "leg_lower_L",
- [10] = "leg_lower_R",
- [11] = "ankle_L",
- [12] = "ankle_R",
- [13] = "hand_L",
- [14] = "hand_R",
- [15] = "arm_upper_L",
- [16] = "arm_lower_L",
- [17] = "arm_upper_R",
- [18] = "arm_lower_R",
- }
- local drawPair = {
- [11] = {9}, -- L angkle to lower
- [12] = {10}, -- R ankle to lower
- [9] = {7}, -- L lower to upper
- [10] = {8}, -- R lower to upper
- [7] = {2}, -- L upper to pelvis
- [8] = {2}, -- R upper to pelvis
- [2] = {3}, -- Pelvis to spine 0
- [3] = {4}, -- Spine 0 to spine 1
- [4] = {5}, -- Spine 1 to spine 2
- [5] = {6}, -- Spine 2 to spine 3
- [6] = {1, 15, 17}, -- Spine 3 to neck and upper arms
- [1] = {0}, -- Neck to head
- [15] = {16}, -- L arm upper to L arm lower
- [17] = {18}, -- R arm upper to R arm lower
- [16] = {13}, -- L arm lower to L hand
- [18] = {14}, -- R arm lower to R hand
- }
- -- Game events
- client_set_event_callback("run_command", function(cmd)
- if not ui_get(menu.draw_fake) then
- return
- end
- if cmd.chokedcommands == 1 then
- for i = 0, 18 do
- hitboxPos[i] = {entity_hitbox_position(entity_get_local_player(), i)}
- end
- end
- end)
- local debug_cb = ui_new_checkbox("AA", "Other", "Debug")
- client_set_event_callback("paint", function()
- if not ui_get(menu.draw_fake) then
- return
- end
- if not ui_get(thirdperson) or not ui_get(thirdperson_hotkey) then
- return
- end
- if not entity_is_alive(entity_get_local_player()) or #hitboxPos == 0 then
- return
- end
- local r, g, b, a = ui_get(menu.draw_fake_color)
- for k, v in pairs(drawPair) do
- local x1, y1 = renderer_world_to_screen(hitboxPos[k][1], hitboxPos[k][2], hitboxPos[k][3])
- for i = 1, #v do
- local x2, y2 = renderer_world_to_screen(hitboxPos[v[i]][1], hitboxPos[v[i]][2], hitboxPos[v[i]][3])
- if x1 ~= nil and y1 ~= nil and x2 ~= nil and y2 ~= nil then
- renderer_line(x1 + 1, y1 + 1, x2 + 1, y2 + 1, r, g, b, a)
- renderer_line(x1, y1 + 1, x2, y2 + 1, r, g, b, a)
- renderer_line(x1 - 1, y1 + 1, x2 - 1, y2 + 1, r, g, b, a)
- renderer_line(x1 + 1, y1, x2 + 1, y2, r, g, b, a)
- renderer_line(x1, y1, x2, y2, r, g, b, a)
- renderer_line(x1 - 1, y1, x2 - 1, y2, r, g, b, a)
- renderer_line(x1 + 1, y1 - 1, x2 + 1, y2 - 1, r, g, b, a)
- renderer_line(x1, y1 - 1, x2, y2 - 1, r, g, b, a)
- renderer_line(x1 - 1, y1 - 1, x2 - 1, y2 - 1, r, g, b, a)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement