Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Lazarus#4454
- -- Menu
- local menu_check_box = menu.add_check_box
- local menu_get_bool = menu.get_bool
- local menu_set_int = menu.set_int
- -- Math
- local math_random = math.random
- -- Callback / Event
- local events_register_event = events.register_event
- local client_add_callback = client.add_callback
- -- Entitylist
- entitylist_get_local_player = entitylist.get_local_player
- -- Our menu additions
- menu_check_box("Leg breaker")
- -- FFI
- local ffi = require "ffi"
- ffi.cdef[[
- typedef uintptr_t (__thiscall* GetClientEntity_4242425_t)(void*, int);
- ]]
- local entity_list_ptr = ffi.cast("void***", utils.create_interface("client.dll", "VClientEntityList003"))
- local get_client_entity_fn = ffi.cast("GetClientEntity_4242425_t", entity_list_ptr[0][3])
- local ffi_helpers = {
- get_animstate_offset = function()
- return 14612
- end,
- get_entity_address = function(ent_index)
- local addr = get_client_entity_fn(entity_list_ptr, ent_index)
- return addr
- end
- }
- -- Lets break our legs!
- client_add_callback("on_paint", function()
- if menu_get_bool("Leg breaker") then
- local localplayer = entitylist_get_local_player()
- if not localplayer then return end
- ffi.cast("float*", ffi_helpers.get_entity_address(localplayer:get_index()) + 10100)[0] = 0
- menu_set_int("misc.leg_movement", math_random(1, 2))
- end
- end)
Add Comment
Please, Sign In to add comment