⚡ Marvel Rivals - Lua API Documentation

Complete guide to LuaJIT scripting for hero automation

🔍

📖 Overview

Marvel Rivals Lua scripting allows you to create custom hero automation using LuaJIT with aggressive JIT optimization. Scripts run at 60-144+ FPS and have access to complete game state, actor information, and input control.

Script Structure

Basic Script Template
-- Default hero script
-- This script is called every frame (60-144+ times per second)
function on_game_tick(ctx, helpers, config)
    -- ctx: Game state (player info, enemies, abilities, etc.)
    -- helpers: Utility functions (UseAbility, CountEnemiesInFOV, etc.)
    -- config: Your script configuration values

    return true
end

⚠️ Performance Guidelines

Global Cooldown

All input functions (UseAbility, SendSkill) have a 50ms global cooldown to prevent spam. Use helpers.CanDoAction() to check if you can send an input.