Advertisement
Mister_Stefan

KeyBinds LWv4

Apr 10th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.46 KB | None | 0 0
  1. local font = render.create_font("Verdana", 12, 400, true, true, false)
  2.  
  3. menu.add_check_box("Enable keybind list")
  4. menu.add_color_picker("Keybind color")
  5. menu.add_slider_int("Keybind position X", 0, engine.get_screen_width())
  6. menu.add_slider_int("Keybind position Y", 0, engine.get_screen_height())
  7.  
  8. local get_state, get_mode = menu.get_key_bind_state, menu.get_key_bind_mode
  9. local types = { "hold", "toggled" }
  10. local screen_x, screen_y = engine.get_screen_width(),engine.get_screen_height()
  11. local count = 0
  12.  
  13. local function add_bind(name, bind_name, x, y)
  14.  
  15.     if get_state(bind_name) then
  16.  
  17.         render.draw_text(font, x + 5, y + 22 + (15 * count), color.new(255, 255, 255), name)
  18.      
  19.         text_width = render.get_text_width(font, "[" .. types[get_mode(bind_name)+1] .. "]")
  20.      
  21.         render.draw_text(font, x + 170 - text_width - 5, y + 22 + (15 * count), color.new(255, 255, 255), "[" .. types[get_mode(bind_name)+1] .. "]")
  22.      
  23.         count = count + 1
  24.      
  25.     end
  26.  
  27. end
  28.  
  29. local function on_paint()
  30.  
  31.     if not menu.get_bool("Enable keybind list") then return end
  32.  
  33.     if not engine.is_connected() then return end
  34.  
  35.     local color = menu.get_color("Keybind color")
  36.  
  37.     local pos_x = menu.get_int("Keybind position X")
  38.     local pos_y = menu.get_int("Keybind position Y")
  39.  
  40.     render.draw_rect_filled_gradient(pos_x, pos_y, 170, 20, color.new(0, 0, 0, 255), color.new(0, 0, 0, 0), 1)
  41.     render.draw_rect_filled(pos_x, pos_y, 170, 22 + (15 * count) + 3, color.new(0, 0, 0, 120))
  42.  
  43.     render.draw_text_centered(font, pos_x + 85, pos_y + 12, color.new(255, 255, 255), true, true, "hotkey list")
  44.  
  45.     render.draw_rect_filled_gradient(pos_x, pos_y, 85, 2, color.new(0, 0, 0, 0), color, 0)
  46.     render.draw_rect_filled_gradient(pos_x + 85, pos_y, 85, 2, color, color.new(0, 0, 0, 0), 0)
  47.  
  48.     count = 0
  49.  
  50.     add_bind("> Doubletap", key_binds.double_tap, pos_x, pos_y)
  51.     add_bind("> Hideshots", key_binds.hide_shots, pos_x, pos_y)
  52.     add_bind("> Force body-aim", key_binds.body_aim, pos_x, pos_y)
  53.     add_bind("> Anti-aim inverter", key_binds.flip_desync, pos_x, pos_y)
  54.     add_bind("> Thirdperson", key_binds.thirdperson, pos_x, pos_y)
  55.     add_bind("> Autopeek", key_binds.automatic_peek, pos_x, pos_y)
  56.     add_bind("> Fakeduck", key_binds.fakeduck, pos_x, pos_y)
  57.     add_bind("> Slowwalk", key_binds.slowwalk, pos_x, pos_y)
  58.     add_bind("> Damage override", key_binds.damage_override, pos_x, pos_y)
  59.  
  60. end
  61.  
  62. client.add_callback("on_paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement