This script is an example for "client.create_interface". With this function you can access classes or functions provided by the game itself.
local ffi =require'ffi'ffi.cdef[[typedefunsignedcharwchar_t;typedefbool (__thiscall *IsButtonDown_t)(void*,int);]]local interface_ptr = ffi.typeof('void***')local raw_inputsystem = client.create_interface('inputsystem.dll', 'InputSystemVersion001')-- cast the lightuserdata to a type that we can dereferencelocal inputsystem = ffi.cast(interface_ptr, raw_inputsystem) -- void***-- dereference the interface pointer to get its vtablelocal inputsystem_vtbl = inputsystem[0] -- void**-- vtable is an array of functions, the 15th is IsButtonDownlocal raw_IsButtonDown = inputsystem_vtbl[15] -- void*-- cast the function pointer to a callable typelocal is_button_pressed = ffi.cast('IsButtonDown_t', raw_IsButtonDown)localfunctionrun_command(cmd)ifis_button_pressed(inputsystem, 36) then-- ButtonCode_t for Zprint('Z is pressed')endreturnfalseendclient.set_event_callback('run_command', run_command)