SHARE
TWEET

Untitled

a guest Jan 29th, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local script = {
  2.     menu = { "AA", "Other"}
  3. }
  4.  
  5. function script:call(func, name, ...)
  6.     if func == nil then
  7.         return
  8.     end
  9.  
  10.     local end_name = name[2] or ""
  11.  
  12.     if name[1] ~= nil then
  13.         end_name = end_name ~= "" and (end_name .. " ") or end_name
  14.         end_name = end_name .. "\n " .. name[1]
  15.     end
  16.  
  17.     return func(self.menu[1], self.menu[2], end_name, ...)
  18. end
  19.  
  20. local active = script:call(ui.new_checkbox, { "mn_active", "Manyouall" })
  21. local picker = script:call(ui.new_color_picker, { "mn_manual_color_picker", "Color picker" }, 130, 156, 212, 255)
  22. local left_dir = script:call(ui.new_hotkey, { "mn_manual_left", "Left direction" })
  23. local right_dir = script:call(ui.new_hotkey, { "mn_manual_right", "Right direction" })
  24. local back_dir = script:call(ui.new_hotkey, { "mn_manual_back", "Backwards direction" })
  25. local manual_state = script:call(ui.new_slider, { "mn_manual_state", nil }, 0, 3, 0)
  26. local arrow_dst = script:call(ui.new_slider, { "mn_manual_arrow_distance", nil }, 1, 100, 12, true, "%")
  27. local picker_inactive = script:call(ui.new_color_picker, { "mn_manual_color_picker_inactive", "Color picker" }, 130, 156, 212, 255)
  28.  
  29.  
  30.  
  31. local yaw, yaw_num = ui.reference("AA", "Anti-aimbot angles", "Yaw")
  32.  
  33. local multi_exec = function(func, list)
  34.     if func == nil then
  35.         return
  36.     end
  37.    
  38.     for ref, val in pairs(list) do
  39.         func(ref, val)
  40.     end
  41. end
  42.  
  43. local compare = function(tab, val)
  44.     for i = 1, #tab do
  45.         if tab[i] == val then
  46.             return true
  47.         end
  48.     end
  49.    
  50.     return false
  51. end
  52.  
  53. local bind_system = {
  54.     left = false,
  55.     right = false,
  56.     back = false
  57. }
  58.  
  59. function bind_system:update()
  60.     ui.set(left_dir, "On hotkey")
  61.     ui.set(right_dir, "On hotkey")
  62.     ui.set(back_dir, "On hotkey")
  63.  
  64.     local m_state = ui.get(manual_state)
  65.  
  66.     local left_state, right_state, back_state = ui.get(left_dir), ui.get(right_dir), ui.get(back_dir)
  67.  
  68.     if  left_state == self.left and
  69.         right_state == self.right and
  70.         back_state == self.back then
  71.         return
  72.     end
  73.  
  74.     self.left, self.right, self.back = left_state, right_state, back_state
  75.  
  76.     if (left_state and m_state == 1) or (right_state and m_state == 2) or (back_state and m_state == 3) then
  77.         ui.set(manual_state, 3)
  78.         return
  79.     end
  80.  
  81.     if left_state and m_state ~= 1 then
  82.         ui.set(manual_state, 1)
  83.     end
  84.  
  85.     if right_state and m_state ~= 2 then
  86.         ui.set(manual_state, 2)
  87.     end
  88.  
  89.     if back_state and m_state ~= 3 then
  90.         ui.set(manual_state, 3)
  91.  
  92.     end
  93. end
  94.  
  95. local menu_callback = function(e, menu_call)
  96.         local visible = not ui.get(active) -- or (e == nil and menu_call == nil)
  97.         local manual = ui.get(active)
  98.  
  99.         multi_exec(ui.set_visible, {
  100.             [picker] = not visible and manual,
  101.             [arrow_dst] = not visible and manual,
  102.             [left_dir] = not visible and manual,
  103.             [right_dir] = not visible and manual,
  104.             [back_dir] = not visible and manual,
  105.             [picker] = not visible and manual,
  106.             [manual_state] = false
  107.         })
  108. end
  109. client.set_event_callback("setup_command", function(e)
  110.     if not ui.get(active) then
  111.         return
  112.     end
  113.  
  114.     local direction = ui.get(manual_state)
  115.  
  116.     local manual_yaw = {
  117.         [0] = direction ~= 0 and "0",
  118.         [1] = -90,
  119.         [2] = 90,
  120.         [3] = 0
  121.     }
  122.  
  123.     multi_exec(ui.set, {
  124.         [yaw_num] = manual_yaw[direction]
  125.     })
  126. end)
  127. client.set_event_callback("round_end", function()
  128.     ui.set(manual_state, 3)
  129. end)
  130. client.set_event_callback("shutdown", menu_callback)
  131. client.set_event_callback("paint", function()
  132.     menu_callback(true, true)
  133.     bind_system:update()
  134.  
  135.     local me = entity.get_local_player()
  136.    
  137.     if not entity.is_alive(me) or not ui.get(active) then
  138.         return
  139.     end
  140.  
  141.     if ui.get(active) then
  142.         local w, h = client.screen_size()
  143.         local r, g, b, a = ui.get(picker)
  144.         local r_1, g_1, b_1, a_1 = ui.get(picker_inactive)
  145.    
  146.         local m_state = ui.get(manual_state)
  147.    
  148.         local realtime = globals.realtime() % 3
  149.         local distance = (w/2) / 210 * ui.get(arrow_dst)
  150.         local alpha = math.floor(math.sin(realtime * 8) * (a/2-1) + a/2) or a
  151.    
  152.         renderer.text(w/2 - distance, h / 2 - 1, r_1, g_1, b_1, a_1, "+c", 0, "<")
  153.         renderer.text(w/2 + distance, h / 2 - 1, r_1, g_1, b_1, a_1, "+c", 0, ">")
  154.         renderer.text(w/2, h / 2 + distance, r_1, g_1, b_1, a_1, "+c", 0, "v")
  155.  
  156.         if m_state == 1 then
  157.             renderer.text(w/2 - distance, h / 2 - 1, r, g, b, alpha, "+c", 0, "<")
  158.         end
  159.         if m_state == 2 then
  160.             renderer.text(w/2 + distance, h / 2 - 1, r, g, b, alpha, "+c", 0, ">")
  161.         end
  162.    
  163.         if m_state == 3 then
  164.             renderer.text(w/2, h / 2 + distance, r, g, b, alpha, "+c", 0, "v")
  165.         end
  166.     end
  167. end)
  168.  
  169. menu_callback(active)
  170. ui.set_callback(active, menu_callback)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top