Lua API Documentation

Create powerful scripts for N3NY000 using our comprehensive Lua API

Where to Put Lua Scripts

Place your Lua script files (.lua) in this folder:

C:\N3NYOOO\lua

Create the folder if it doesn't exist. Scripts will be automatically loaded when you start the menu.

Getting Started

Welcome to the N3NY000 Lua API documentation. This API allows you to create custom scripts that extend the functionality of the N3NY000 menu.

Quick Setup

1. Create a new .lua file in C:\N3NYOOO\lua

2. Write your script using the API functions below

3. Save the file and restart the menu

4. Your script will be loaded automatically

Basic Script Structure

Lua
-- My First N3NY000 Script
script_name("My First Script")
script_author("Your Name")
script_version("1.0")

-- This function runs when the script loads
function on_load()
    log("Script loaded successfully!")
    notify("Hello from Lua!", "success")
end

-- This function runs every game frame
function on_tick()
    -- Your code here
end

-- Register the script
register_script()

Basic Functions

log(message)
Logs a message to the console for debugging purposes.
message string

The message to log to the console

Example
log("This is a debug message")
notify(message, type)
Shows a notification on screen to the player.
message string

The notification message to display

type string (optional)

Type of notification: "success", "warning", "error", "info"

Example
notify("Script activated!", "success")
notify("Warning: Low health", "warning")
notify("Error occurred", "error")
sleep(milliseconds)
Pauses script execution for the specified time.
milliseconds number

Time to sleep in milliseconds (1000ms = 1 second)

Example
notify("Wait 3 seconds...")
sleep(3000)
notify("Done waiting!")

Player Functions

player.get_health()
Gets the current health of the local player.
Returns: number - Player's current health (0-100)
Example
local health = player.get_health()
log("Current health: " .. health)
player.set_health(amount)
Sets the health of the local player.
amount number

Health value to set (0-100)

Example
player.set_health(100)
notify("Health restored!", "success")
player.teleport(x, y, z)
Teleports the player to specified coordinates.
x number

X coordinate

y number

Y coordinate

z number

Z coordinate (height)

Example
-- Teleport to Fort Zancudo
player.teleport(-2360.0, 3249.0, 92.9)
notify("Teleported to Fort Zancudo", "info")

Vehicle Functions

vehicle.spawn(model_name)
Spawns a vehicle near the player.
model_name string

Name of the vehicle model to spawn (e.g., "adder", "t20")

Returns: number - Vehicle handle ID
Example
local car = vehicle.spawn("adder")
notify("Vehicle spawned!", "success")
vehicle.repair(vehicle_id)
Repairs a vehicle.
vehicle_id number (optional)

Vehicle handle. If not provided, repairs current vehicle

Example
vehicle.repair()
notify("Vehicle repaired!", "success")

World Functions

world.set_time(hour, minute)
Sets the in-game time.
hour number

Hour (0-23)

minute number

Minute (0-59)

Example
world.set_time(12, 0) -- Set to noon
world.set_time(0, 0)  -- Set to midnight
world.set_weather(weather_type)
Changes the weather.
weather_type string

Weather type: "clear", "rain", "thunder", "snow", "fog"

Example
world.set_weather("clear")
notify("Weather changed to clear", "info")

UI Functions

ui.draw_text(text, x, y, size, color)
Draws text on screen.
text string

Text to display

x number

X position (0.0 to 1.0)

y number

Y position (0.0 to 1.0)

size number (optional)

Text size (default: 0.5)

color table (optional)

RGBA color {r, g, b, a} (0-255)

Example
ui.draw_text("Hello World!", 0.5, 0.5, 1.0, {255, 255, 255, 255})

Complete Examples

Example Scripts

Here are some complete example scripts to help you get started:

Example 1: Auto Health Regeneration

auto_heal.lua
-- Auto Health Regeneration Script
script_name("Auto Heal")
script_author("N3NY000")
script_version("1.0")

function on_tick()
    local health = player.get_health()

    -- If health is below 50, heal to 100
    if health < 50 then
        player.set_health(100)
        notify("Health restored!", "success")
        sleep(5000) -- Wait 5 seconds before next heal
    end
end

register_script()

Example 2: Vehicle Spawner

vehicle_spawner.lua
-- Quick Vehicle Spawner
script_name("Vehicle Spawner")
script_author("N3NY000")
script_version("1.0")

-- List of favorite vehicles
local vehicles = {"adder", "t20", "zentorno", "insurgent"}
local current_index = 1

function on_load()
    log("Vehicle Spawner loaded!")
    notify("Press [F9] to spawn vehicle", "info")
end

function on_key_press(key)
    if key == "F9" then
        local car = vehicle.spawn(vehicles[current_index])
        notify("Spawned: " .. vehicles[current_index], "success")

        -- Move to next vehicle in list
        current_index = current_index + 1
        if current_index > #vehicles then
            current_index = 1
        end
    end
end

register_script()

Example 3: Teleport Menu

teleporter.lua
-- Teleport Locations Script
script_name("Teleporter")
script_author("N3NY000")
script_version("1.0")

-- Popular locations
local locations = {
    ["Airport"] = {-1336.0, -3044.0, 13.9},
    ["Fort Zancudo"] = {-2360.0, 3249.0, 92.9},
    ["Mount Chiliad"] = {501.8, 5604.5, 797.9},
    ["Beach"] = {-1388.0, -1277.0, 4.0}
}

function on_load()
    notify("Teleporter loaded! Use menu to teleport", "info")
end

function teleport_to(location_name)
    local coords = locations[location_name]
    if coords then
        player.teleport(coords[1], coords[2], coords[3])
        notify("Teleported to " .. location_name, "success")
    end
end

register_script()

Important Notes

• Script Location: All scripts must be placed in C:\N3NYOOO\lua

• File Extension: Scripts must have a .lua file extension

• Auto-Loading: Scripts are loaded automatically when the menu starts

• Debugging: Use the log() function to debug your scripts

• Performance: Avoid heavy operations in on_tick() as it runs every frame