Lua API

Script the menu

Every namespace and callable in MVP Plus, generated straight from the bindings — not written by hand. Search it, or browse by namespace.

Where your scripts go: %LOCALAPPDATA%\Nenyoo\Plus\Scripts\User\ — there's a Script folder action in the menu that opens it. Add -- @nenyoo-menu to turn a script into its own menu page. Press F10 in game for the Lua console.

Two threads, don't mix them. Game natives, memory.* and entity.* belong on the script thread (script.on_tick, util.create_thread). Drawing — draw.*, text.*, directx.* — belongs on the render thread (overlay.on_draw, a theme's draw_menu). Crossing over crashes the game. Yield with util.yield(ms), never the WAIT native.

Write your own scripts against engine + foundation. The Stand layer only exists so third-party Stand scripts run — those go in Scripts\User\stand\.

1 · A toggle script

A plain .lua in Scripts\User\ becomes a single on/off toggle. Use this for one self-contained behaviour.

-- Scripts\User\heal_me.lua
-- No marker = this whole file is one toggle.

script.on_tick(function()
    local me = PLAYER.PLAYER_PED_ID()
    ENTITY.SET_ENTITY_HEALTH(me, 328)
end)

Ticks on the script thread while the toggle is on, so game natives are fair game here.

2 · A sub-menu script

Add -- @nenyoo-menu and the file becomes its own expandable page, loaded only when opened.

-- Scripts\User\my_tools.lua
-- @nenyoo-menu
local root = menu.my_root()

menu.action(root, "Heal me", {}, "Full health", function()
    local me = PLAYER.PLAYER_PED_ID()
    ENTITY.SET_ENTITY_HEALTH(me, 328)
end)

menu.toggle(root, "God mode", {}, "Stay alive", function(on)
    local me = PLAYER.PLAYER_PED_ID()
    PLAYER.SET_PLAYER_INVINCIBLE(PLAYER.PLAYER_ID(), on)
end, false)

local sub = menu.list(root, "More", {}, "Nested page")
menu.action(sub, "Repair car", {}, "", function()
    local me = PLAYER.PLAYER_PED_ID()
    local v = PED.GET_VEHICLE_PED_IS_IN(me, false)
    if v ~= 0 then VEHICLE.SET_VEHICLE_FIXED(v) end
end)

Order is (parent, label, commands, help, callback, default). An Unload Script action is added for you.

Loading the Lua API…
Stuck on a script? Ask in Discord — setup, theming and Stand guides live there too.
Join Discord