Advertisement
Mister_Stefan

LW4 NL Keybinds

Jun 6th, 2021
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. local font = render.create_font("Verdana", 12, 400, true, false, false)
  2. local icon = render.create_font("untitled-font-1", 13, 400, true, false, false)
  3.  
  4. menu.add_check_box("Enable keybind list")
  5. menu.add_color_picker("Key binds color")
  6. menu.add_slider_int("Key binds position X", 0, engine.get_screen_width())
  7. menu.add_slider_int("Key binds position Y", 0, engine.get_screen_height())
  8.  
  9. local types = {"always", "holding", "toggled"}
  10.  
  11. local get_state, get_mode = menu.get_key_bind_state, menu.get_key_bind_mode
  12. local screen_x, screen_y = engine.get_screen_width(), engine.get_screen_height()
  13. local count = 0
  14.  
  15. local function add_bind(name, bind_name, x, y)
  16.     if get_state(bind_name) then
  17.         render.draw_text(font, x, y + 22 + (15 * count), color.new(255, 255, 255), name)    
  18.         text_width = render.get_text_width(font, "[" .. types[get_mode(bind_name) + 1] .. "]")
  19.      
  20.         render.draw_text(font, x + 155 - text_width - 5, y + 22 + (15 * count), color.new(255, 255, 255), "[" .. types[get_mode(bind_name) + 1] .. "]")    
  21.         count = count + 1  
  22.     end
  23. end
  24.  
  25. local function on_paint()
  26.     if not menu.get_bool("Enable keybind list") then
  27.         return
  28.     end
  29.  
  30.     if not engine.is_in_game() then
  31.         return
  32.     end
  33.  
  34.     local color = menu.get_color("Key binds color")
  35.     local pos_x = menu.get_int("Key binds position X")
  36.     local pos_y = menu.get_int("Key binds position Y")
  37.  
  38.     render.draw_rect_filled(pos_x, pos_y, 150, 20, color.new(0, 0, 0, 200))
  39.     render.draw_text(font, pos_x + 21, pos_y + 2, color.new(255, 255, 255), "keybinds")
  40.     render.draw_rect_filled(pos_x, pos_y + 19, 150, 2, color)
  41.    
  42.     render.draw_text(icon, pos_x + 5, pos_y + 2, color, "a")
  43.  
  44.     count = 0
  45.  
  46.     add_bind("Hide shots", "rage.hide_shots_key", pos_x, pos_y)
  47.     add_bind("Edge jump", "misc.edge_jump_key", pos_x, pos_y)
  48.     add_bind("Double tap", "rage.double_tap_key", pos_x, pos_y)
  49.     add_bind("Slow walk", "misc.slow_walk_key", pos_x, pos_y)
  50.     add_bind("Force damage", "rage.force_damage_key", pos_x, pos_y)
  51.     add_bind("Invert desync", "anti_aim.invert_desync_key", pos_x, pos_y)
  52.     add_bind("Fake duck", "anti_aim.fake_duck_key", pos_x, pos_y)
  53.     add_bind("Automatic peek", "misc.automatic_peek_key", pos_x, pos_y)
  54.     add_bind("Third person", "misc.third_person_key", pos_x, pos_y)
  55. end
  56.  
  57. client.add_callback("on_paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement