Mister_Stefan

LW4 Leg Fucker

Jun 6th, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. -- Made by Lazarus#4454
  2.  
  3. -- Menu
  4. local menu_check_box = menu.add_check_box
  5. local menu_get_bool = menu.get_bool
  6. local menu_set_int = menu.set_int
  7.  
  8. -- Math
  9. local math_random = math.random
  10.  
  11. -- Callback / Event
  12. local events_register_event = events.register_event
  13. local client_add_callback = client.add_callback
  14.  
  15. -- Entitylist
  16. entitylist_get_local_player = entitylist.get_local_player
  17.  
  18. -- Our menu additions
  19. menu_check_box("Leg breaker")
  20.  
  21. -- FFI
  22. local ffi = require "ffi"
  23.  
  24. ffi.cdef[[
  25.     typedef uintptr_t (__thiscall* GetClientEntity_4242425_t)(void*, int);
  26. ]]
  27.  
  28. local entity_list_ptr = ffi.cast("void***", utils.create_interface("client.dll", "VClientEntityList003"))
  29. local get_client_entity_fn = ffi.cast("GetClientEntity_4242425_t", entity_list_ptr[0][3])
  30.  
  31. local ffi_helpers = {
  32.     get_animstate_offset = function()
  33.         return 14612
  34.     end,
  35.  
  36.     get_entity_address = function(ent_index)
  37.         local addr = get_client_entity_fn(entity_list_ptr, ent_index)
  38.         return addr
  39.     end
  40. }
  41.  
  42. -- Lets break our legs!
  43. client_add_callback("on_paint", function()
  44.     if menu_get_bool("Leg breaker") then
  45.         local localplayer = entitylist_get_local_player()
  46.         if not localplayer then return end
  47.         ffi.cast("float*", ffi_helpers.get_entity_address(localplayer:get_index()) + 10100)[0] = 0
  48.  
  49.         menu_set_int("misc.leg_movement", math_random(1, 2))
  50.      end
  51. end)
Add Comment
Please, Sign In to add comment