Advertisement
Guest User

Untitled

a guest
May 27th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. local ui_get, ui_set, ui_set_visible, ui_ref = ui.get, ui.set, ui.set_visible, ui.reference
  2. local ui_desynctype = ui.new_combobox
  3. local client_draw_text = client.draw_text
  4. local client_screensize = client.screen_size
  5. local client_set_event_callback = client.set_event_callback
  6.  
  7.  
  8. -- Anti-aim references
  9. local pitch = ui_ref("AA", "Anti-aimbot angles", "Pitch")
  10. local base = ui_ref("AA", "Anti-aimbot angles", "Yaw base")
  11. local yaw, yaw_slider = ui_ref("AA", "Anti-aimbot angles", "Yaw")
  12. local yawjitter, yawjitter_slider = ui_ref("AA", "Anti-aimbot angles", "Yaw jitter")
  13. local bodyyaw, bodyyaw_slider = ui_ref("AA", "Anti-aimbot angles", "Body yaw")
  14. local limit = ui_ref("AA", "Anti-aimbot angles", "Fake yaw limit")
  15. local edgeyaw = ui_ref("AA", "Anti-aimbot angles", "Edge yaw")
  16. local freestanding = ui_ref("AA", "Anti-aimbot angles", "Freestanding")
  17. local twist = ui_ref("AA", "Anti-aimbot angles", "Twist")
  18. local lby = ui_ref("AA", "Anti-aimbot angles", "Lower body yaw")
  19.  
  20. -- UI Elements
  21. local ui_desync = ui.new_checkbox("AA", "Fake lag", "Mad's Jitter Desync")
  22. local ui_indicator_color_picker = ui.new_color_picker("AA", "Fake lag", "Indicator color", "0", "255", "255", "255")
  23. local ui_desynctype = ui.new_combobox("AA", "Fake Lag", "Desync Type", {"1"})
  24. local ui_indicatortype = ui.new_combobox("AA", "Fake Lag", "Indicator Type", {"Default", "Triangle", "Fatality"})
  25. local ui_left_hotkey = ui.new_hotkey("AA", "Fake lag", "Manual-Desync Left")
  26. local ui_right_hotkey = ui.new_hotkey("AA", "Fake lag", "Manual-Desync Right")
  27. local ui_back_hotkey = ui.new_hotkey("AA", "Fake lag", "Manual-Desync Back")
  28. local ui_rainbow = ui.new_checkbox("AA", "Fake Lag", "Rainbow")
  29. local ui_rainbowspeed = ui.new_slider("AA", "Fake Lag", "Rainbow Speed", 1, 10, 3, true)
  30. local ui_prevent_leaks = ui.new_checkbox("AA", "Fake lag", "Prevent Leaks")
  31.  
  32. --Entity setup
  33. local entity_get_local_player = entity.get_local_player
  34. local entity_get_all = entity.get_all
  35. local entity_get_players = entity.get_players
  36. local entity_get_classname = entity.get_classname
  37. local entity_set_prop = entity.set_prop
  38. local entity_is_alive = entity.is_alive
  39. local entity_get_prop = entity.get_prop
  40. local entity_is_enemy = entity.is_enemy
  41. local entity_get_player_name = entity.get_player_name
  42. local entity_get_player_weapon = entity.get_player_weapon
  43. local entity_hitbox_position = entity.hitbox_position
  44.  
  45. local globals_realtime = globals.realtime
  46. local globals_curtime = globals.curtime
  47. local globals_frametime = globals.frametime
  48. local globals_absolute_frametime = globals.absoluteframetime
  49. local globals_maxplayers = globals.maxplayers
  50. local globals_tickcount = globals.tickcount
  51. local globals_tickinterval = globals.tickinterval
  52. local globals_mapname = globals.mapname
  53.  
  54. local isLeft, isRight, isBack = false
  55.  
  56. local function get_antiaim_dir()
  57.  
  58. if ui_get(ui_left_hotkey) then
  59. isLeft = true
  60. isRight = false
  61. isBack = false
  62. elseif ui_get(ui_right_hotkey) then
  63. isRight = true
  64. isLeft = false
  65. isBack = false
  66. elseif ui_get(ui_back_hotkey) then
  67. isRight = false
  68. isLeft = false
  69. isBack = true
  70. end
  71. end
  72.  
  73.  
  74. local function setLeft()
  75. if ui_get(ui_desynctype) == "1" then
  76. ui_set(pitch, "Default")
  77. ui_set(base, "Local view")
  78. ui_set(yaw, "180")
  79. ui_set(yaw_slider, -90)
  80. ui_set(yawjitter, "Center")
  81. ui_set(yawjitter_slider, "100")
  82. ui_set(bodyyaw, "Opposite")
  83. ui_set(limit, "60")
  84. ui_set(edgeyaw, "Off")
  85. ui_set(freestanding, "-")
  86. end
  87. end
  88.  
  89. local function setRight()
  90. if ui_get(ui_desynctype) == "1" then
  91. ui_set(pitch, "Default")
  92. ui_set(base, "Local view")
  93. ui_set(yaw, "180")
  94. ui_set(yaw_slider, 90)
  95. ui_set(yawjitter, "Center")
  96. ui_set(yawjitter_slider, "-100")
  97. ui_set(bodyyaw, "Opposite")
  98. ui_set(limit, "60")
  99. ui_set(edgeyaw, "Off")
  100. ui_set(freestanding, "-")
  101. end
  102. end
  103.  
  104. local function setBack()
  105. ui_set(yaw, "180")
  106. ui_set(yaw_slider, 6)
  107. ui_set(bodyyaw, "Off")
  108. ui_set(yawjitter, "Off")
  109. end
  110.  
  111.  
  112. local function hsv_to_rgb(h, s, v, a)
  113. local r, g, b
  114.  
  115. local i = math.floor(h * 6);
  116. local f = h * 6 - i;
  117. local p = v * (1 - s);
  118. local q = v * (1 - f * s);
  119. local t = v * (1 - (1 - f) * s);
  120.  
  121. i = i % 6
  122.  
  123. if i == 0 then r, g, b = v, t, p
  124. elseif i == 1 then r, g, b = q, v, p
  125. elseif i == 2 then r, g, b = p, v, t
  126. elseif i == 3 then r, g, b = p, q, v
  127. elseif i == 4 then r, g, b = t, p, v
  128. elseif i == 5 then r, g, b = v, p, q
  129. end
  130.  
  131. return r * 255, g * 255, b * 255, a * 255
  132. end
  133.  
  134. local function func_rgb_rainbowize(frequency, rgb_split_ratio)
  135. if ui_get(ui_rainbow) then
  136. local r, g, b, a = hsv_to_rgb(globals.realtime() * frequency, 1, 1, 1)
  137.  
  138. r = r * rgb_split_ratio
  139. g = g * rgb_split_ratio
  140. b = b * rgb_split_ratio
  141.  
  142. return r, g, b
  143. end
  144. end
  145.  
  146. local function on_paint(c)
  147. if not ui_get(ui_desync) then
  148. return
  149. end
  150.  
  151. local scrsize_x, scrsize_y = client_screensize()
  152. local center_x, center_y = scrsize_x / 2, scrsize_y / 2
  153. if ui_get(ui_indicatortype) == "Default" then
  154. client.draw_text(c, center_x + 50, center_y, 255, 255, 255, 155, "c+", 0, ">")
  155. client.draw_text(c, center_x - 50, center_y, 255, 255, 255, 155, "c+", 0, "<")
  156. client_draw_text(c, center_x, center_y + 40, 255, 255, 255, 155, "c+", 0, "v")
  157. else if ui_get(ui_indicatortype) == "Triangle" then
  158. client.draw_text(c, center_x + 50, center_y, 255, 255, 255, 155, "c+", 0, "►")
  159. client.draw_text(c, center_x - 50, center_y, 255, 255, 255, 155, "c+", 0, "◄")
  160. client_draw_text(c, center_x, center_y + 40, 255, 255, 255, 155, "c+", 0, "▼")
  161. else if ui_get(ui_indicatortype) == "Fatality" then
  162. client.draw_text(c, center_x + 50, center_y, 255, 255, 255, 155, "c+", 0, "⮞")
  163. client.draw_text(c, center_x - 50, center_y, 255, 255, 255, 155, "c+", 0, "⮜")
  164. client_draw_text(c, center_x, center_y + 40, 255, 255, 255, 155, "c+", 0, "⮟")
  165. end
  166. end
  167. end
  168. local indicator_r, indicator_g, indicator_b, indicator_a = ui_get(ui_indicator_color_picker)
  169. get_antiaim_dir()
  170.  
  171.  
  172. local r, g, b = func_rgb_rainbowize(0. + ui_get(ui_rainbowspeed) / 8, 1)
  173. if ui_get(ui_rainbow) then
  174. ui_set(ui_indicator_color_picker, r, g, b, 160)
  175. ui_set_visible(ui_rainbowspeed, true)
  176. else ui_set_visible(ui_rainbowspeed, false)
  177. end
  178.  
  179. if isLeft then
  180. if ui_get(ui_indicatortype) == "Default" then
  181. client.draw_text(c, center_x - 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "<")
  182. else if ui_get(ui_indicatortype) == "Triangle" then
  183. client.draw_text(c, center_x - 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "◄")
  184. else if ui_get(ui_indicatortype) == "Fatality" then
  185. client.draw_text(c, center_x - 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "⮜")
  186. end
  187. end
  188. end
  189. elseif isRight then
  190. if ui_get(ui_indicatortype) == "Default" then
  191. client.draw_text(c, center_x + 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, ">")
  192. else if ui_get(ui_indicatortype) == "Triangle" then
  193. client.draw_text(c, center_x + 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "►")
  194. else if ui_get(ui_indicatortype) == "Fatality" then
  195. client.draw_text(c, center_x + 50, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "⮞")
  196. end
  197. end
  198. end
  199. elseif isBack then
  200. if ui_get(ui_indicatortype) == "Default" then
  201. client_draw_text(c, center_x, center_y + 40, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "v")
  202. else if ui_get(ui_indicatortype) == "Triangle" then
  203. client_draw_text(c, center_x, center_y + 40, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "▼")
  204. else if ui_get(ui_indicatortype) == "Fatality" then
  205. client_draw_text(c, center_x, center_y + 40, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "⮟")
  206. end
  207. end
  208. end
  209. end
  210. end
  211.  
  212. local function on_setup_command(cmd)
  213. if entity_get_local_player() == nil or entity_get_prop(entity_get_local_player(), "m_lifeState") ~= 0 then
  214. return
  215. end
  216. if isLeft then
  217. setLeft()
  218. end
  219. if isRight then
  220. setRight()
  221. end
  222. if isBack then
  223. setBack()
  224. end
  225. if ui_get(ui_prevent_leaks) then
  226. if cmd.chokedcommands > 0 then
  227. if cmd.forwardmove == 0 and cmd.in_jump == 0 and cmd.in_attack == 0 then
  228. cmd.forwardmove = globals_tickcount() % 2 < 1 and -1.01 or 1.01
  229. end
  230. end
  231. end
  232. end
  233.  
  234. client_set_event_callback('setup_command', on_setup_command)
  235. client_set_event_callback("paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement