Skip to content

LuaModLoader

A Lua mod loader for the 2020 Steam re-release of GTA IV, the "Complete Edition", build 1.2.0.59, x86.

The classic ASI Loader and ScriptHookIV do not work on this build. LuaModLoader is the modern alternative: write mods in Lua, call the game's natives directly, and never touch raw memory or C++. It also brings the ASI loader back, so existing .asi plugins run on Complete Edition again.

It installs as four files in the GTA IV folder and starts with the game. There is no launcher, and nothing to click.

-- Keep the player's health and armor topped up, once a second
Thread.Create(function()
    while true do
        local ped = GetPlayerChar(GetPlayerId())
        SetCharHealth(ped, 200)
        AddArmourToChar(ped, 100)
        Thread.Wait(1000)
    end
end)

Download Write your first mod


What you get

  • 3,158 natives as PascalCase globals. SetCharHealth(ped, 200) uses the same names as ScriptHookDotNet scripts and classic trainers, so ported code needs no renaming. The canonical SNAKE_CASE form stays reachable through the natives table and Native.Call.
  • A namespaced API. Everything the loader itself provides lives under Thread, Console, Log, Draw, Color, Input, Gamepad, Native, Memory, Vehicle and Script. No bare global can collide with a native.
  • A coroutine scheduler. Thread.Create and a blocking Thread.Wait(ms) that suspends your code without freezing the game.
  • Your own natives. Native.Register puts a Lua function into the game's native table, where any other mod can call it by hash, whatever language it is written in.
  • A live code editor. Write, run and reload Lua without restarting GTA IV.
  • Rendering and input. Draw text and rectangles over the game, read the keyboard and the gamepad, and isolate the game's inputs while your menu is open.
  • An ASI loader, so .asi plugins load again on this build.

Documentation


Compatible mods

  • ProTrainer-IV is a complete trainer menu, opened with F4.
  • The script examples cover a HUD speedometer with nitro, a god-mode toggle, a never-wanted script, and more.

This site documents the engine

The repository holds the native engine, meaning the loader and its C++ API. Complete mods built on that API live in their own repositories.