LuaModLoader
A Lua-based mod loader for the 2020 Steam re-release of GTA IV ("Complete Edition", build 1.2.0.59, x86).
Since the classic ASI Loader and ScriptHookIV do not work on this specific version of GTA IV, LuaModLoader offers a modern alternative: it allows you to run scripts and mods directly in Lua without needing to manipulate raw memory or write C++ code.
Architecture and Operation
The project is divided into two main components:
binkw32.dll(Proxy Loader): A lightweight proxy loaded automatically by the game (similar to Ultimate ASI Loader). It forwards real Bink calls to the original file (binkw32_orig.dll) and silently loads the real mod DLL in the background.LuaModLoader.dll(Native Payload): The core of the program. It includes a Lua 5.4 interpreter, DirectX hooks for rendering (D3D9), input hooks (DirectInput), and a built-in text editor.
Key Features
- In-game Code Editor: Press F6 to open the Lua editor (powered by Scintilla) to write, run, or test code live without restarting the game or using an external program.
- Dual Naming Conventions (SNAKE_CASE & PascalCase): Directly call over 3,100+ native functions using either standard
SNAKE_CASE(e.g.SET_CHAR_HEALTH(ped, 200)) orPascalCase(e.g.SetCharHealth(ped, 200)/GetPlayerId()) for seamless compatibility with ScriptHookDotNet scripts. - Rendering and Inputs: Draw rectangles/text on the screen over the game, and cleanly intercept keys (
is_key_down,set_menu_open) to isolate game inputs when your mod is active.
Mod Example and Compatible Scripts
LuaModLoader makes creating mods very accessible. Here is a simple example of a script using the loader's native API:
-- Lua mod example: Set the player's health and armor
local player_index = GET_PLAYER_ID()
local player_ped = GET_PLAYER_CHAR(player_index)
SET_CHAR_HEALTH(player_ped, 200)
ADD_ARMOUR_TO_CHAR(player_ped, 100)
msgbox("Health and armor updated!")
Here are some compatible scripts and mods:
- ProTrainer-IV: A complete trainer menu (F4).
- Vehicle Nitro & Speedometer: A full mod with a HUD display and nitro on the Shift key.
- Heal & Armor: Instant player health recovery.
- Never Wanted: Automatically resets police wanted stars.
- God Mode Toggle: Toggle invincibility on F3.
π Quick Documentation Links
- π Native Database Explorer (2,780+ Functions): Interactive search, category filters, and 1-click Lua copy.
- π Your First Lua Mod: 3-minute beginner guide to creating and running a mod.
- β¨οΈ Keyboard Keys & Events:
onTick(),is_key_down(), and key codes table. - π Common Natives Guide: Practical guide on how to code (health, cars, weapons, AI, weather).
- βοΈ Mod Loader Lua API: Built-in loader utilities (
draw_text,draw_rect,msgbox,log...). - π GTA IV Reference Lists: Easy copy-paste IDs for weapons, cars, and weather.
- π‘ Script Examples Catalog: 5 ready-to-use scripts with explanations.
Installation (Users)
You do not need to compile the project to use it.
[!TIP] An automatic installer will be available soon to make this process even easier! In the meantime, here is the manual method:
- Go to the Releases tab and download the latest version (
binkw32.dll,LuaModLoader.dll,Scintilla.dll,Lexilla.dll). - Go to the root folder of GTA IV.
- Rename the existing
binkw32.dllfile tobinkw32_orig.dll(VERY IMPORTANT, this file manages the game's video and audio). - Copy the 4 downloaded files into this same folder.
To uninstall: delete the 4 copied files and rename binkw32_orig.dll back to binkw32.dll.
Compilation (Developers)
Requirements:
- Visual Studio 2026 ("Desktop development with C++", x86 toolset)
- CMake
[!WARNING] Always target Win32/x86 -
GTAIV.exeis a 32-bit process. A DLL compiled in x64 will never work with this game.
Output generated in the build\out\Release\ folder:
LuaModLoader.dllbinkw32.dll- (
Scintilla.dllandLexilla.dllwill be automatically copied there).