Wiki Raiden for GTA V Lua Scripting Write, run and share Lua scripts with the editor built into Raiden for GTA V. 33 min read Updated 14 Sep 2026 On this page Opening the editorYour first scriptThe Scripts panelThe Editor panelWhere scripts are storedSingle-file scriptsMulti-file scripts (folders)Access levelsViewing script output and errorsHow a script runsWhat happens when something goes wrongExamples1. Loops and sleeping2. Adding options to Raiden's menu3. Reacting to events4. Custom windows5. Saving settings to a fileAPI referenceraiden: basicslog, notify, utilscript: loops and background workgui: Raiden menu optionsevent: eventsmenuNativesHelpers: vec3, selfObject-style API: Entity, Ped, Vehicle, PlayerImGui: drawingjson and filesAdvancedScripts from other menusLua 5.3 and 5.4 scriptsYimMenu scriptsYimMenuV2 scriptsTroubleshootingKnown issues Raiden has a built-in Lua editor and script loader. You can write a script in the menu and run it straight away, or put .lua files in your Scripts folder so they load every time you log in. Scripts can call game natives, add their own toggles, sliders and buttons to Raiden, draw their own windows, and react to events like players joining. Raiden runs scripts on LuaJIT, which follows Lua 5.1 syntax. Scripts written for Lua 5.3 or 5.4 usually work too, because Raiden translates the newer syntax for you. Many scripts made for YimMenu also run without changes. See Scripts from other menus. WarningOnly run scripts from people you trust. A script can read and write files on your PC, change game memory and call any native. A broken script can crash your game. #Opening the editor Open the menu. Go to Misc, then open the Lua Scripts tab. The tab has three panels: PanelWhat it's for Scripts (left)Every script found in your Scripts folder and whether it loaded. Click one to open it in the editor. Editor (right)A file name box, a code box, and the Run, Save and Save & reload buttons. Script tabs (bottom)Controls from YimMenu scripts that create their own menu tabs. Each tab is a section you can expand. See YimMenu scripts. Scripts only load while you're logged in to Raiden. #Your first script In the Editor panel, type a file name such as hello.lua. Paste this into the code box: LuaCopyraiden.notify("Hello from Lua!") raiden.log("My first script ran.") Click Run. A notification appears in-game. Click Save to keep it. Next time you log in, it loads automatically. #The Scripts panel ButtonWhat it does ReloadStops every running script, rescans the Scripts folder, and loads everything again. Open folderOpens your Scripts folder in File Explorer. The counter next to the buttons (for example 3 / 4 loaded) shows how many scripts are running out of how many were found. The 5.1 compat dropdown controls when Lua 5.3/5.4 syntax is translated (see Lua 5.3 and 5.4 scripts): SettingWhat it does Auto (detect)The default. A script is translated only if it doesn't run as Lua 5.1. Always onEvery script and module is translated before it runs. OffNothing is translated. Scripts that use newer syntax show error. The setting applies the next time scripts load, so press Reload after changing it. It goes back to Auto when you restart the game. Each script has a coloured status dot: StatusColourMeaning loadedGreenRunning. errorRedFailed to load. Hover to see the error message. lockedAmberYour account level is too low for this script. Hover to see the level it needs. idleGreyFound but not running. Click a script to open it in the editor. Its code goes into the code box and its name into the file name box. #The Editor panel ButtonWhat it does RunRuns whatever is in the code box right now. Doesn't save. SaveWrites the code box to your Scripts folder under the file name you typed. Doesn't run it. .lua is added if you left it off. Save & reloadSaves, then reloads every script from the folder. Use this after editing a script that's already running. Things to know: Each Run starts another copy. Pressing Run three times gives you three copies at once, which means three windows, three loops and so on. Press Reload to stop every copy you started with Run. After that, only saved scripts are running. Scripts you Run show in the list with the name you typed, but clicking them does nothing because they aren't files. The code box has a size limit. It starts at about 32 KB. Opening a bigger file makes room for the whole file plus about 64 KB more, so nothing is cut off. When the box is full, further typing is ignored. For big scripts, an external editor such as VS Code is more comfortable; use Reload after saving there. Tab inserts a tab in the code box. It doesn't move to the next control. #Where scripts are stored Copy%APPDATA%\Raiden\GTA5\Scripts Paste that into the File Explorer address bar, or click Open folder in the Scripts panel. #Single-file scripts Any .lua file placed directly in the Scripts folder is loaded. #Multi-file scripts (folders) A script can also be a folder. Raiden decides what to run inside each folder like this: It runs the first of these it finds: <FolderName>.lua (for example MyTools\MyTools.lua), main.lua, init.lua. If none of those exist, it runs every .lua file placed directly in the folder, the same way YimMenu does. For example, SSV2\samurais_scripts.lua runs and its modules in SSV2\includes\ don't. If the folder has no .lua files of its own, it runs includes\init.lua or, failing that, includes\main.lua. Inside a folder script, require looks in the folder, then in each of its subfolders, then in the Scripts folder. It skips any subfolder with disabled in its name. CopyScripts\ └── MyTools\ ├── main.lua -- starting file └── includes\ └── helpers.lua LuaCopy-- main.lua local helpers = require("includes.helpers") -- loads includes\helpers.lua local same = require("helpers") -- also finds includes\helpers.lua require can't load compiled .dll modules or precompiled bytecode. Scripts must be plain-text Lua. #Access levels A script can say which account level it needs. Put a tag in a comment within the first 30 lines, but this can be easily bypassed and isn't a secure way to enforce access: LuaCopy-- @access STANDARD TagWho can load it STANDARDStandard and above ULTIMATEUltimate and above TESTERTesters and admins A script with no tag counts as STANDARD. Raiden only reads the first line that contains @access. If your account level is too low, the script shows as locked. To check your own level from a script, use raiden.access_level(). It returns a number: 1 = Free, 2 = Standard, 3 = Elite, 4 = Ultimate, 5 = Tester, 6 = Admin. #Viewing script output and errors Raiden writes messages from raiden.log, log.*, script errors and load messages in three places: In-game Log window. Open Settings → Search, search for in-game log, and turn it on. The window only shows while the menu is open. Messages are on its Engine log tab. Its Console tab lets you type commands. The Raiden console window that opens alongside the game. The log file: %APPDATA%\Raiden\GTA5\Raiden.log Script messages are tagged LuaScript or Lua and look similar to this: Copy[Info] LuaScript hello.lua loaded (ticking) (drawing). [Error] LuaScript broken.lua failed: [string "broken.lua"]:3: attempt to call a nil value #How a script runs When a script loads, its top-level code runs once. To keep doing something after that, register a callback. Register withWhen it runsNativesImGui.*script.sleep Top-level codeOnce, when the script loads✅❌❌ raiden.on_tick(fn)Every game tick. Only one per script; a second call replaces the first.✅❌❌ script.register_looped(fn)Over and over, starting again as soon as it returns✅❌✅ script.run_in_fiber(fn)Once, in the background✅❌✅ gui.add_action(..., fn)When the button is pressed✅❌❌ event.register_handler(name, fn)When the event happens✅❌❌ raiden.on_draw(fn) / menu.add_imgui(fn)Every frame while the menu is open⚠️ Don't✅❌ menu.add_always_draw_imgui(fn)Every frame, even when the menu is closed⚠️ Don't✅❌ Rule of thumb: draw callbacks run on the render thread, and everything else runs on the game's script thread. Call natives from loops, ticks, actions and events. Use ImGui.* only inside draw callbacks. If a button in your window needs to do something in-game, set a variable in the draw callback and act on it in a loop. See Custom windows. #What happens when something goes wrong A Lua error, such as calling a nil value, is handled differently from a crash. A crash is a native or memory access violation, for example from a bad pointer or a native called with invalid arguments. Where it happensLua errorCrash Top-level codeThe script shows error and doesn't load.The same. raiden.on_tickLogged, and the whole script is unloaded.The same. script.register_looped / run_in_fiberLogged, and only that loop stops. The rest of the script keeps running.The whole script is unloaded. Draw callback or YimMenu tabLogged, and the script keeps running. Missing End() / Pop*() calls are cleaned up for you.The whole script is unloaded. Action or event handlerLogged, and the script keeps running.The whole script is unloaded. Raiden catches the crash and unloads only that script, and other scripts keep running. The log line says hard fault or hard-faulted. When a script is unloaded by Reload or a Lua error in on_tick, its menu_event.Unload handlers run first. Use them to save settings. They don't run when a script is unloaded because of a crash, because it's no longer safe to run its code. Drawing never makes the game wait for scripts. If a script's loop, action or event handler is still running when a frame is drawn, for example while Vehicle.create waits up to 2 seconds for a model to load, Raiden skips drawing script windows for that frame. They can flicker or disappear briefly as a result. #Examples #1. Loops and sleeping script.sleep(ms) pauses only this loop. It never freezes the game. LuaCopy-- Heals you back to full health every half second. script.register_looped(function() local ped = PLAYER.PLAYER_PED_ID() local max = ENTITY.GET_ENTITY_MAX_HEALTH(ped) if ENTITY.GET_ENTITY_HEALTH(ped) < max then ENTITY.SET_ENTITY_HEALTH(ped, max, 0) end script.sleep(500) end) script.sleep and script.yield only work inside script.register_looped or script.run_in_fiber. Anywhere else you get attempt to yield across C-call boundary. #2. Adding options to Raiden's menu gui.add_* creates real Raiden options. They show up in Settings → Search, work as console commands, and can be pinned to the quickbar. LuaCopy-- @access FREE local heal = gui.add_toggle("My Script", "Auto heal", false) local delay = gui.add_slider_int("My Script", "Heal delay (ms)", 500, 100, 5000) local mode = gui.add_combo("My Script", "Heal mode", 0, { "Full", "Half" }) gui.add_action("My Script", "Clear wanted level", function() PLAYER.CLEAR_PLAYER_WANTED_LEVEL(PLAYER.PLAYER_ID()) raiden.notify("Wanted level cleared") end) script.register_looped(function() if heal:get() then local ped = PLAYER.PLAYER_PED_ID() local max = ENTITY.GET_ENTITY_MAX_HEALTH(ped) local target = (mode:get() == 0) and max or math.floor(max / 2) if ENTITY.GET_ENTITY_HEALTH(ped) < target then ENTITY.SET_ENTITY_HEALTH(ped, target, 0) end end script.sleep(delay:get()) end) Reading and changing values. handle:get(), handle:set(value), or handle.value. Toggles give true/false, sliders give numbers, and combos give the index of the chosen item, starting at 0. Command names. Each option's command name is the group and label with spaces and symbols removed, all lowercase, joined by a dot. "My Script", "Auto heal" becomes myscript.autoheal. In the Console tab of the Log window: Copymyscript.autoheal toggles it myscript.healdelayms 250 sets the slider ("Heal delay (ms)" becomes healdelayms) myscript.clearwantedlevel presses the button find myscript lists all of your script's commands Options keep their values when you press Reload. They stay listed until you restart the game, even if you delete the script. #3. Reacting to events LuaCopyevent.register_handler(event.player_join, function(player_id) raiden.notify(players.get_name(player_id) .. " joined the session") end) event.register_handler(event.player_leave, function(player_id) raiden.log("Player " .. player_id .. " left") end) event.register_handler(menu_event.Unload, function() raiden.log("Script is unloading, saving settings...") end) menu_event.PlayerJoin and menu_event.PlayerLeave also work, but their handlers get YimMenu's arguments: the player's name first, then the player id. See event: events. #4. Custom windows Raiden uses Dear ImGui for its interface, and scripts can use it too. Drawing happens on the render thread, so the window only records what was clicked. The loop does the in-game work. LuaCopylocal my_name = "" -- filled in by the loop, shown by the window local god_mode = false local god_mode_applied = false local fix_requested = false raiden.on_draw(function() -- Only ImGui in here. No natives. if ImGui.Begin("My Tools") then ImGui.Text("Hello, " .. my_name) ImGui.Separator() god_mode = ImGui.Checkbox("God mode", god_mode) if ImGui.Button("Fix vehicle") then fix_requested = true end end ImGui.End() -- always call End, even if Begin returned false end) script.register_looped(function() my_name = players.get_local():get_name() -- Only call the native when the checkbox changes, so the script -- doesn't fight other features that set invincibility. if god_mode ~= god_mode_applied then ENTITY.SET_ENTITY_INVINCIBLE(PLAYER.PLAYER_PED_ID(), god_mode) god_mode_applied = god_mode end if fix_requested then fix_requested = false local veh = players.get_local():get_ped():get_vehicle() if veh:is_valid() then veh:fix() end end end) Return values. Widgets that edit a value return two things: the new value, then whether it changed this frame. LuaCopyspeed, changed = ImGui.SliderFloat("Speed", speed, 0.0, 100.0) if changed then raiden.log("speed is now " .. speed) end Use menu.add_always_draw_imgui(fn) instead of raiden.on_draw(fn) for something that should stay on screen with the menu closed, like a HUD. #5. Saving settings to a file LuaCopy-- Keep data outside the Scripts folder so Raiden doesn't scan it for scripts. local path = filesystem.get_appdata_path("GTA5\\ScriptData", "my_script.json") local function load_settings() local text = filesystem.read(path) return (text and json.decode(text)) or { enabled = false, delay = 500 } end local function save_settings(t) filesystem.write(path, json.encode(t, true)) -- true = pretty-print end local settings = load_settings() event.register_handler(menu_event.Unload, function() save_settings(settings) end) filesystem.get_appdata_path(subfolder, file) returns %APPDATA%\Raiden\<subfolder>\<file> and creates the folder if it doesn't exist. #API reference #raiden: basics FunctionDescription raiden.log(message)Writes an info line to the log, tagged LuaScript. raiden.notify(message)Shows an in-game notification. raiden.access_level()Your account level as a number (see Access levels). raiden.on_tick(fn)Runs fn every game tick. One per script; a second call replaces the first. raiden.on_draw(fn)Runs fn every frame while the menu is open. ImGui.* works here. A script can register several. #log, notify, util FunctionDescription log.info(msg) / log.warning(msg) / log.debug(msg)Writes to the log at that level. The line starts with the script's file name, e.g. myscript.lua: hello. log.warn(msg) / log.error(msg) / log.verbose(msg) / log.trace(msg)Writes to the log at that level, without the file name. verbose and trace write debug-level lines. notify.info(title, [message]) / .success / .warn / .errorShows a notification. All four currently look the same. util.joaat(text) / joaat(text)Converts a name to a game hash, e.g. joaat("adder"). util.time()Current time in milliseconds since 1970. get_game_branch()0 on GTA V Legacy, 1 on GTA V Enhanced. #script: loops and background work FunctionDescription script.register_looped([name], fn)Runs fn over and over. name is optional and ignored. script.run_in_fiber([name], fn)Runs fn once in the background. script.run_in_callback does the same. script.sleep(ms)Pauses the current loop or fiber for ms milliseconds. script.yield([ms])Pauses until the next tick, or for ms milliseconds if given. script.is_inside_callback()true while running inside a loop or fiber. script.is_active(name) / scripts.is_active(name)true if that game script, e.g. "freemode", is running. name can also be a hash. script.execute_as_script(name, fn)Runs fn as part of that game script, for natives that only work from inside it. Returns true if the script was running and fn ran. An error in fn is raised as usual. Not allowed in draw callbacks. scripts.run_as_script(name, fn)The same, but errors inside fn are ignored and nothing is returned. A loop or fiber function also receives a helper as its first argument, the same one YimMenu passes, so s:sleep(ms) and s:yield() work like script.sleep and script.yield: LuaCopyscript.register_looped(function(s) s:sleep(1000) end) #gui: Raiden menu options FunctionReturns gui.add_toggle(group, label, default)Toggle handle (true/false) gui.add_slider_int(group, label, default, min, max)Whole-number handle. min/max default to 0/100. gui.add_slider_float(group, label, default, min, max)Decimal handle. min/max default to 0.0/1.0. gui.add_combo(group, label, default_index, { "A", "B", ... })Handle holding the chosen index, starting at 0 gui.add_action(group, label, fn)Button handle. fn runs when it's pressed. gui.get(handle) / gui.set(handle, value)Same as handle:get() / handle:set(value) Handles also have handle.value (read or write), handle.id (the command name), and handle.on and handle:is_enabled(), which mean the same as handle.value and handle:get(). Calling gui.add_* again with the same group and label, for example after Reload, returns the existing option with its current value. The default only applies the first time. YimMenu's gui.add_tab and related functions are also available. See YimMenu scripts. #event: events Register with event.register_handler(name, fn). Raiden's own event names are strings. YimMenu's menu_event values are numbers, and their handlers get the arguments YimMenu gives, so the same event can arrive in two shapes. EventHandler receives event.player_join ("player_join")player_id event.player_leave ("player_leave")player_id "scripted_game_event"A table of the event's arguments menu_event.Unload ("unload")Nothing. Runs just before the script is unloaded. menu_event.PlayerJoinplayer_name, player_id menu_event.PlayerLeaveplayer_name menu_event.PlayerMgrInit / menu_event.PlayerMgrShutdownNothing. Runs when you join or leave an online session. menu_event.ScriptedGameEventReceivedsender, args. sender is always -1 because Raiden can't tell who sent it. args is a table. menu_event.MenuUnloaded / menu_event.ScriptsReloadedNothing. Both run just before the script is unloaded, the same as menu_event.Unload. menu_event.Wndprochwnd, msg, wparam, lparam for each key press, mouse button, mouse wheel and window focus change. Mouse movement isn't sent. menu_event.ChatMessageReceivedNever runs yet. #menu FunctionDescription menu.add_imgui(fn)Same as raiden.on_draw(fn). menu.add_always_draw_imgui(fn)Draws every frame, even with the menu closed. menu.is_open()true if the menu is open. menu.toggle()Opens the menu if it's closed and closes it if it's open. menu.get_menu_name()"Raiden" menu.get_submenu, menu.find_submenu, menu.create_group, menu.set_menu_name, menu.set_menu_iconAccepted for YimMenuV2 scripts. See YimMenuV2 scripts. internal.spawn_vehicle(model_name)Spawns a vehicle at your position, facing your direction. Waits up to 2 seconds for the model to load. #Natives About 6,600 game natives are available as NAMESPACE.NATIVE_NAME(...): LuaCopylocal ped = PLAYER.PLAYER_PED_ID() local pos = ENTITY.GET_ENTITY_COORDS(ped, true) -- a vec3 with .x, .y, .z ENTITY.SET_ENTITY_COORDS(ped, pos.x, pos.y, pos.z + 10.0, false, false, false, false) Two sets of names. Raiden's older names and the current names YimMenu uses both work, so GAMEPLAY.GET_HASH_KEY and MISC.GET_HASH_KEY call the same native. The older namespaces GAMEPLAY, UI, AI and CONTROLS are called MISC, HUD, TASK and PAD in the current set. A native that was renamed is available under both its old and its current name. Other namespaces include PLAYER, ENTITY, PED, VEHICLE, OBJECT, WEAPON, STREAMING, CAM, GRAPHICS, AUDIO, NETWORK and STATS. Booleans. Pass true / false. In Lua, 0 counts as true, so SET_ENTITY_INVINCIBLE(ped, 0) turns invincibility on. Model names. Convert names to hashes with util.joaat("adder") or MISC.GET_HASH_KEY("adder"). Vectors. Natives that take a Vector3 accept a vec3, { x = 1, y = 2, z = 3 }, { 1, 2, 3 } or a Vector3. Natives that return one give a vec3. Output parameters. Leave them out of the call. They come back as extra return values after the normal result: LuaCopylocal found, ground_z = MISC.GET_GROUND_Z_FOR_3D_COORD(x, y, 1000.0, false, false) Scripts written for YimMenu pass a starting value for every output parameter instead, e.g. MISC.GET_GROUND_Z_FOR_3D_COORD(x, y, 1000.0, 0.0, false, false). That works too. Raiden treats a call with a value for every parameter as YimMenu style. Calling by hash. natives.call_int(hash, ...), natives.call_float, natives.call_bool and natives.call_void call any native by its hash, given as a number or a "0x..." string. The name says what the native returns. Arguments are sent by their Lua type: true/false become 1/0, strings are sent as text, and numbers with a fraction, like 1.5, are sent as decimals. A whole number is always sent as an integer, even if you write 1.0, so prefer the named natives for anything that takes a float. Output parameters aren't supported this way. #Helpers: vec3, self FunctionDescription vec3(x, y, z), vec3(table), vec3.new(x, y, z) or vec3:new(x, y, z)A vector with .x, .y, .z that supports +, -, * number, :magnitude(), :distance(other) and tostring. vec3 is a class table, so a script can add its own methods and operators, like function vec3:length() ... end, and every vector gets them. self.get_ped()Your ped handle self.get_id() / self.get_player_id()Your player id self.get_name()Your player name self.get_pos()Your position as a vec3 self.get_heading()Your heading self.get_veh([last]) / self.get_vehicle([last])The handle of the vehicle you're in (0 if none), or of your last vehicle if last is true #Object-style API: Entity, Ped, Vehicle, Player A friendlier layer over natives. Ped and Vehicle also have all the Entity methods. LuaCopylocal me = players.get_local() -- Player local ped = me:get_ped() -- Ped ped:set_health(ped:get_max_health()) ped:teleport_to(Vector3.new(-75.0, -818.0, 326.0)) local car = Vehicle.create("adder", ped:get_position(), 0.0) CreateDescription Entity(handle) / Ped(handle) / Vehicle(handle), or .new(handle)Wrap an existing handle Ped.create(model, position, [heading]) / Vehicle.create(model, position, [heading])Spawn one. model can be a name or hash. Waits up to 2 seconds for the model to load and returns nil if it didn't. Player(player_id) / Player.new(player_id)Wrap a player id Vector3(x, y, z) / Vector3.new(x, y, z)Vector with .x, .y, .z (read or write), :get_distance(other), :is_zero() and :get_coords(), which returns x, y, z. The methods below return positions as Vector3. players.get_local() / players.get_all() / players.get_random()Player objects players.get_selected() / players.set_selected(player)The player a script selected, or you if none was selected players.is_valid(id) / players.get_name(id) / players.get_ped(id)Look up a player by id. get_ped returns a Ped object. players.get_by_rid(rid) / players.get_by_message_id(id)Always nil in Raiden entities.get_all_peds_as_handles() / get_all_vehicles_as_handles() / get_all_objects_as_handles()Lists of handles near you entities.take_control_of(handle, [wait_ms])Requests network control of an entity, waiting up to wait_ms (300 by default). Returns true if you have control. Methods: Entity: get_handle, is_valid, is_ped, is_vehicle, is_object, is_player, is_mission_entity, get_model, get_position, set_position, get_rotation([order]), set_rotation(rotation, [order]), get_velocity, set_velocity, get_heading, set_heading, get_speed, set_collision, set_frozen, has_interior, is_networked, is_remote, has_control, request_control([timeout_ms]), force_control, prevent_migration, get_network_object_id, is_invincible, set_invincible, is_dead, kill, get_health, set_health, get_max_health, is_visible, set_visible, get_alpha, set_alpha, reset_alpha, delete Ped: get_vehicle, get_last_vehicle, get_vehicle_object_id, set_in_vehicle(vehicle, [seat]), get_ragdoll, set_ragdoll, get_bone_position(bone), is_enemy, get_accuracy, set_accuracy, give_weapon(weapon, [equip]), remove_weapon, get_current_weapon, has_weapon, set_infinite_ammo, set_infinite_clip, set_max_ammo_for_weapon, teleport_to, get_armour, set_armour, randomize_outfit, start_scenario(name, [delay], [play_enter_anim]), set_keep_task, clear_damage, set_max_time_underwater, set_as_cop, add_to_group, remove_from_group, is_member_of_group, set_leader_of_group Vehicle: fix, upgrade, get_speed, get_plate_text, set_plate_text, is_seat_free(seat), supports_boost, is_boost_active, set_boost_charge([percent]), bring_to_halt(distance, duration), set_on_ground_properly, get_full_name, get_gear, get_rev_ratio, lower_stance Player: is_valid, is_local, is_host, is_modder, get_id, get_name, get_ped, set_ped(ped), get_rank, get_rp, get_money, get_wanted_level, set_wanted_level, get_max_armour, teleport_to, set_visible_locally, get_average_latency, get_average_packet_loss, get_group, set_fall_distance_override, get_message_id, get_rid, get_external_address, get_internal_address Weapons and models can be given as names or hashes. request_control waits up to timeout_ms (100 by default). Some methods only exist so scripts written for YimMenuV2 load, and don't return real data: Vehicle:get_gear() and :get_rev_ratio() always return 0, and :lower_stance() does nothing. Player:get_rid() returns 0, and :get_external_address() / :get_internal_address() return "0.0.0.0", 0. Player:is_host() can only be true for you. Player:is_modder() is always false outside an online session. Ped:is_enemy() returns true for any ped that isn't a player. Ped:set_infinite_ammo() and :set_infinite_clip() both give an infinite clip. #ImGui: drawing Available only inside raiden.on_draw, menu.add_imgui and menu.add_always_draw_imgui. Calling it anywhere else gives the error ImGui.X can only be called from raiden.on_draw. CategoryFunctions WindowsBegin, End, BeginChild, BeginChildEx, EndChild, BeginChildFrame, EndChildFrame, SetNextWindowPos, SetNextWindowSize, SetNextWindowSizeConstraints, SetNextWindowContentSize, SetNextWindowBgAlpha, SetNextWindowCollapsed, SetNextWindowFocus, SetWindowPos, SetWindowSize, SetWindowCollapsed, SetWindowFocus, SetWindowFontScale, GetWindowPos, GetWindowSize, GetWindowWidth, GetWindowHeight, IsWindowFocused, IsWindowHovered, IsWindowAppearing, IsWindowCollapsed, GetContentRegionAvail, GetContentRegionMax, GetWindowContentRegionMin, GetWindowContentRegionMax ScrollingGetScrollX, GetScrollY, GetScrollMaxX, GetScrollMaxY, SetScrollX, SetScrollY, SetScrollHereX, SetScrollHereY, SetScrollFromPosX, SetScrollFromPosY LayoutSeparator, SeparatorText, SameLine, NewLine, Spacing, Dummy, Indent, Unindent, BeginGroup, EndGroup, AlignTextToFramePadding, PushItemWidth, PopItemWidth, SetNextItemWidth, CalcItemWidth, PushTextWrapPos, PopTextWrapPos, GetCursorPos, SetCursorPos, GetCursorPosX, GetCursorPosY, SetCursorPosX, SetCursorPosY, GetCursorScreenPos, SetCursorScreenPos, GetCursorStartPos, GetTextLineHeight, GetTextLineHeightWithSpacing, GetFrameHeight, GetFrameHeightWithSpacing, GetFontSize TextText, TextUnformatted, TextColored(r, g, b, a, text), TextDisabled, TextWrapped, LabelText, BulletText, Bullet, Value, CalcTextSize ButtonsButton(label, [width], [height]), SmallButton, InvisibleButton, ArrowButton, Checkbox, RadioButton, ProgressBar(fraction, [width], [height], [overlay]), PushButtonRepeat, PopButtonRepeat Sliders and inputsSliderInt, SliderInt2/3/4, SliderFloat, SliderFloat2/3/4, SliderAngle, VSliderInt, VSliderFloat, DragInt, DragInt2/3/4, DragFloat, DragFloat2/3/4, InputInt, InputInt2/3/4, InputFloat, InputFloat2/3/4, InputDouble, InputText(label, text, [flags]), InputTextWithHint(label, hint, text, [flags]), InputTextMultiline(label, text, [flags], [width], [height]) ListsCombo(label, index, { items }, count), BeginCombo(label, preview, [flags]), EndCombo, Selectable(label, [selected], [flags], [width], [height]), ListBox, BeginListBox, EndListBox ColourColorEdit3/4, ColorPicker3/4, ColorButton, SetColorEditOptions, ColorConvertFloat4ToU32, ColorConvertU32ToFloat4, ColorConvertRGBAToU32, ColorConvertRGBtoHSV, ColorConvertHSVtoRGB Trees and tabsTreeNode, TreeNodeEx, TreePush, TreePop, GetTreeNodeToLabelSpacing, CollapsingHeader, SetNextItemOpen, BeginTabBar, EndTabBar, BeginTabItem, EndTabItem, SetTabItemClosed Menus and popupsBeginMainMenuBar, EndMainMenuBar, BeginMenuBar, EndMenuBar, BeginMenu, EndMenu, MenuItem, BeginPopup, BeginPopupModal, BeginPopupContextItem, BeginPopupContextWindow, BeginPopupContextVoid, OpenPopup, OpenPopupContextItem, IsPopupOpen, CloseCurrentPopup, EndPopup, BeginTooltip, EndTooltip, SetTooltip Tables and columnsBeginTable(id, columns, [flags], [width], [height]), EndTable, TableSetupColumn, TableHeadersRow, TableNextRow, TableNextColumn, TableSetColumnIndex, Columns, NextColumn, GetColumnIndex, GetColumnWidth, SetColumnWidth, GetColumnOffset, SetColumnOffset, GetColumnsCount Style and IDsPushStyleColor(index, r, g, b, a), PopStyleColor([count]), PushStyleVar(index, value) or PushStyleVar(index, x, y), PopStyleVar([count]), GetStyle, GetStyleColorVec4, GetStyleColorName, PushID, PopID, GetID, PushClipRect, PopClipRect, BeginDisabled([disabled]), EndDisabled Item stateIsItemHovered, IsItemActive, IsItemFocused, IsItemClicked, IsItemEdited, IsItemActivated, IsItemDeactivated, IsItemDeactivatedAfterEdit, IsItemVisible, IsItemToggledOpen, IsAnyItemHovered, IsAnyItemActive, IsAnyItemFocused, IsRectVisible, GetItemRectMin, GetItemRectMax, GetItemRectSize, SetItemDefaultFocus, SetKeyboardFocusHere Keyboard and mouseIsKeyDown, IsKeyPressed, IsKeyReleased, GetKeyPressedAmount, IsMouseDown, IsMouseClicked, IsMouseReleased, IsMouseDoubleClicked, IsMouseDragging, IsMouseHoveringRect, IsAnyMouseDown, GetMousePos, GetMousePosOnOpeningCurrentPopup, GetMouseDragDelta, ResetMouseDragDelta, GetMouseCursor, SetMouseCursor, SetNextFrameWantCaptureKeyboard, SetNextFrameWantCaptureMouse DrawingAddLine, AddRect, AddRectFilled, AddRectFilledMultiColor, AddCircle, AddCircleFilled, AddTriangle, AddTriangleFilled, AddText, GetFontTexUvWhitePixel Clipboard and loggingGetClipboardText, SetClipboardText, LogToTTY, LogToFile, LogToClipboard, LogButtons, LogText, LogFinish MiscGetTime, GetFrameCount, GetFrameRate, GetDisplaySize How the Lua versions differ from C++ ImGui: Positions and sizes come back as two numbers, e.g. local w, h = ImGui.GetDisplaySize() or local x, y = ImGui.GetMousePos(). Begin with a close button. ImGui.Begin(name) returns whether to draw the window. Pass true as the second argument to show a close button: open, draw = ImGui.Begin(name, open, [flags]). To pass flags without a close button, use nil as the second argument. CollapsingHeader, BeginTabItem, BeginPopupModal and MenuItem follow the same rule. With a true/false argument they return the new open or selected state first, then the usual result. Selectable returns the new selected state, then whether it was clicked this frame. Colours for widgets are { r, g, b, a } tables with values from 0 to 1, and ColorEdit/ColorPicker return a new table. Colours for drawing are separate numbers from 0 to 255, with alpha optional except for AddText: AddLine(x1, y1, x2, y2, r, g, b, [a], [thickness]), AddRect(x1, y1, x2, y2, r, g, b, [a], [rounding], [thickness]), AddRectFilled(x1, y1, x2, y2, r, g, b, [a], [rounding]), AddCircle(x, y, radius, r, g, b, [a], [segments], [thickness]), AddCircleFilled(x, y, radius, r, g, b, [a], [segments]), AddTriangle(x1, y1, x2, y2, x3, y3, r, g, b, [a], [thickness]), AddText(x, y, r, g, b, a, text). Drawing uses screen coordinates and draws into the current window, so call these between Begin and End. Enum tables: ImGuiWindowFlags, ImGuiChildFlags, ImGuiCond, ImGuiCol, ImGuiStyleVar, ImGuiInputTextFlags, ImGuiTreeNodeFlags, ImGuiSelectableFlags, ImGuiComboFlags, ImGuiTabBarFlags, ImGuiTabItemFlags, ImGuiTableFlags, ImGuiTableColumnFlags, ImGuiTableRowFlags, ImGuiColorEditFlags, ImGuiHoveredFlags, ImGuiFocusedFlags, ImGuiPopupFlags, ImGuiSliderFlags, ImGuiDir, ImGuiMouseButton, ImGuiMouseCursor, ImGuiKey. Their values match the ImGui version built into Raiden. Names from newer ImGui versions that YimMenu scripts use, such as ImGuiCol.TabSelected, are accepted too. They map to the closest equivalent, or have no effect if there isn't one. Combine flags with bit.bor, or with | (see Lua 5.3 and 5.4 scripts): LuaCopylocal flags = bit.bor(ImGuiWindowFlags.NoResize, ImGuiWindowFlags.AlwaysAutoResize) ImGui.Begin("HUD", nil, flags) #json and files FunctionDescription json.encode(value, [pretty])Converts a Lua value to JSON text. A table whose keys are exactly 1 to n becomes an array, and an empty table becomes []. json.decode(text)Converts JSON text to a Lua value. Returns nil, "invalid json" on failure. filesystem.get_appdata_path([subfolder], [file])Path under %APPDATA%\Raiden. Creates the folder. filesystem.scripts_dir()Path to the Scripts folder filesystem.read(path)File contents, or nil filesystem.write(path, text)Writes the file, creating folders if needed. Returns true/false. filesystem.exists(path) / filesystem.is_dir(path) / filesystem.mkdirs(path) filesystem.list_files(dir) / filesystem.list_folders(dir)File or folder names in dir FileMgr offers the same kind of access for scripts written for YimMenuV2. Relative paths start at %APPDATA%\Raiden: FunctionDescription FileMgr.GetMenuRootPath()%APPDATA%\Raiden FileMgr.ReadFileContent(path)File contents, or "" if it can't be read FileMgr.WriteFileContent(path, text, [append])Writes or appends to the file, creating folders if needed. Returns true/false. FileMgr.DoesFileExist(path) / FileMgr.CreateDir(path) / FileMgr.DeleteFile(path) FileMgr.FindFiles(dir, [extension], [recursive])Full paths of the files in dir, optionally only those with extension Lua's own io.open, io.exists, os.rename and os.remove work as they do in YimMenu: a relative path such as "settings.json" is placed in the script's config folder, %APPDATA%\Raiden\GTA5\scripts_config\<script file name>. Full paths like C:\... are used as given. #Advanced These work with game memory and internal game data. Wrong values can crash the game or cause problems with your online account. They're meant for experienced scripters. LibraryContents globalsBy global index: get_int, set_int, get_uint, set_uint, get_float, set_float, get_string, set_string(index, text, [max_length]), get_vec3, set_vec3, and get_pointer, which returns a pointer to the global. get_int/get_float return nil and set_int/set_float return false if the global can't be reached. localsBy script name (or hash) and index: get_int, set_int, get_uint, set_uint, get_float, set_float, get_vec3, set_vec3, get_pointer ScriptGlobal(index)An object for a global: :at(offset, [size]) returns another ScriptGlobal, :can_access(), and get_* / set_* for int, float, string and vector3 ScriptLocal(script, index)The same for a script local: :at(offset, [size]), and get_* / set_* for int, float and vector3 memoryscan(signature) returns an address with patch({ bytes }), nop(count), address(), add, sub, rip, deref, is_null and get_* / set_*, or nil if not found. scan_pattern(signature) returns a pointer, which is null if not found. allocate(size) / free(pointer), handle_to_ptr(handle) / ptr_to_handle(pointer), pointer(address), and dynamic_call(return_type, { param_types }, pointer), which returns the name of a global function that calls native code at that address. pointer / memory.pointerpointer(address) or pointer.new(address). Methods: get_address, set_address, is_null, is_valid, add(n), sub(n), rip([offset]), deref, get_* / set_* for byte, word, int, dword, qword, float and string (set_string(text, [max_length])), and patch_byte, patch_word, patch_dword, patch_qword(value), which return a patch with :apply() and :restore(). Reads of unreadable memory return nil. ScriptPointer(name, pattern, [offset], [rip], [address])A location inside a game script's code. Methods: add, sub, rip, scan, get_address, get_name. ScriptPatch(script, name, pattern, [offset], { bytes })Patches game script code. Methods: enable, disable, remove. ScriptFunction(script, script_pointer)Calls a function inside a game script with :call(signature, ...). The signature lists one letter per argument, i (integer), f (float), b (boolean) or h (hash), optionally followed by = and the return type, e.g. fn:call("ii=b", 1, 2). scr_function.call_script_functionYimMenu's way of calling a game script function. See YimMenu scripts. statsBy name or hash: get_int, set_int, get_float, set_float, get_bool, set_bool, get_string, set_string, get_masked_int(name, start, size), set_masked_int(name, value, start, size), get_masked_bool(name, bit), set_masked_bool(name, bit, value). By index: get_packed_int, set_packed_int, get_packed_bool, set_packed_bool, set_packed_bool_range(first, last, value). MPX_ in a name becomes your current character's MP0_ or MP1_, and get_character_index() returns 0 or 1. tunablesBy name or hash: get_int, set_int, get_float, set_float, get_bool, set_bool. Unknown tunables read as 0/false. networkis_session_started(), force_script_host(script), trigger_script_event(event_hash, player_bits, format, ...), where format has one letter per argument (i integer, f float, l 64-bit integer, h hash), get_selected_player(), get_player_rank(id), get_player_rp(id), get_player_money(id) and is_player_flagged_as_modder(id). force_script_on_player does nothing. transactionscan_use_transactions(), run_service(category, action, item, value), and create_basket(category, action), which returns a basket with :add_item(item, [secondary], value, stat_value, [quantity]) and :run(). run_service and :run() return true if the transaction started. command.call(name, [args])Runs a Raiden option by its command name. args[1] is used as the value. vehicles.get_vehicle_display_name(model)The vehicle's in-game name #Scripts from other menus #Lua 5.3 and 5.4 scripts LuaJIT only understands Lua 5.1 syntax. When a script, or a module it loads with require, uses syntax from Lua 5.3 or 5.4, Raiden rewrites just those parts before running it: Bitwise operators: a & b, a | b, a ~ b, ~a, a << n, a >> n Floor division: a // b Variable attributes: local x <const> = 5, local f <close> = ... The rest of the file is left as it is, so line numbers in error messages still match your file. When a script is translated, the log shows myscript.lua: applied Lua 5.4 compatibility. Use the 5.1 compat dropdown in the Scripts panel to turn this off or apply it to every script. Code loaded while the script runs is translated the same way. That includes load, loadstring, loadfile and dofile. They only accept Lua source text. Compiled bytecode is refused, whatever mode you pass. Raiden also adds the parts of the newer standard library that LuaJIT lacks: The utf8 library string.pack, string.unpack and string.packsize coroutine.close math.type, math.tointeger, math.ult, math.maxinteger and math.mininteger table.pack, table.unpack and warn _ENV, as another name for the global table Differences from real Lua 5.4: Numbers are always decimals underneath. Bitwise operators give 64-bit results like Lua 5.4 does (1 << 31 is 2147483648), but whole numbers above 2^53 lose precision. The same goes for 64-bit values read with string.unpack. There's no separate integer type. math.type(2.0) returns "integer", and tostring(2.0) gives "2", not "2.0". <const> isn't enforced. Assigning a new value to a <const> variable works instead of being an error. <close> doesn't close anything. The variable works, but its __close method isn't called when it goes out of scope or when coroutine.close closes the coroutine. string.pack handles integers up to 8 bytes and ignores alignment. The ! and X options are accepted but have no effect. local _ENV = ... doesn't change which globals a function sees. Reading _ENV.name works. #YimMenu scripts Scripts written for YimMenu, such as Samurai's Scripts (SSV2), load like any other script. Copy the script's folder into your Scripts folder as it is. Raiden provides YimMenu's Lua API next to its own: YimMenu APIIn Raiden gui.add_tab(name) / gui.get_tab(name) and the tab methods add_tab, add_button, add_text, add_checkbox, add_sameline, add_separator, add_input_int, add_input_float, add_input_string, add_imgui and clearTabs appear in the Script tabs panel at the bottom of Misc → Lua Scripts, each as a section you can expand. Button callbacks run in a fiber, so they can call natives. gui.add_imgui(fn) / gui.add_always_draw_imgui(fn)The same as menu.add_imgui and menu.add_always_draw_imgui. gui.show_message, show_success, show_warning, show_errorAn in-game notification. gui.is_open(), gui.toggle(open)Checks, opens or closes Raiden's menu. gui.override_mouse(true) / gui.mouse_override()Shows the cursor and gives the mouse to the script's windows while Raiden's menu is closed. Game controls are blocked until the script calls gui.override_mouse(false) or is unloaded. Natives with pointer argumentsSupported. See Natives. script.register_looped / script.run_in_fiber callbacks that use their script argument (script:yield(), script:sleep(ms))Supported. script.is_active(name), script.execute_as_script(name, fn)Supported. event.register_handler(menu_event.X, fn)Supported. See event: events for what each handler receives. memory.pointer, memory.scan_pattern, memory.dynamic_callSupported. globals.* and locals.*, including get_uint, get_string, get_vec3 and get_pointerSupported. stats.* by nameSupported. MPX_ in a name becomes your current character's MP0_ or MP1_. network.trigger_script_event(bitset, { hash, sender, ... })Supported. The sender is replaced with your player id. entities.take_control_of, vehicles.get_vehicle_display_nameSupported. command.call(name, args)Runs the Raiden option with that command name. A name Raiden doesn't have is logged once and does nothing. scr_function.call_script_functionSupported, but not from a draw callback. log.info, log.warning, log.debug, joaat, get_game_branch()Supported. Log lines start with the script's file name. get_game_branch() returns 0 on GTA V Legacy and 1 on GTA V Enhanced. io.open, io.exists, os.rename, os.removeRelative paths go to the script's config folder. See json and files. Not supported: memory.dynamic_hook, scr_function.add_script_function_hook, command.call_player and script.start_launcher_script log a warning and do nothing. weapons.get_weapon_display_name returns an empty string. YimMenu scripts check the jit global to tell whether they're running in YimMenuV2, so Raiden removes it. Use local jit = require("jit") if your script needs it. #YimMenuV2 scripts Many scripts written for YimMenuV2 run without changes. commandmgr.add_command, add_bool_command, add_int_command, add_float_command, add_list_command, add_looped_command and get_command create normal Raiden options under the group Lua. menu.get_submenu(...), :add_category(...), :add_group(...) and :imgui(fn) are accepted so those scripts load, but Raiden doesn't create separate submenus for them. Not supported yet: The on_change callback in add_int_command, add_float_command and add_list_command is never called. Read the value in a loop instead. menu.set_menu_name and menu.set_menu_icon do nothing. #Troubleshooting My script isn't in the list. Make sure the file is directly in %APPDATA%\Raiden\GTA5\Scripts and ends in .lua (not .lua.txt; turn on file extensions in File Explorer to check). Folder scripts need one of the starting files. Then press Reload. It says locked. The script needs a higher account level than yours. Hover it to see which one. It says error. Hover it for the error message. The message includes the line number, e.g. [string "myscript.lua"]:12: ... means line 12. It worked, then stopped. An error inside raiden.on_tick unloads the whole script, and so does a crash anywhere in it (the log says hard fault). See What happens when something goes wrong. Check the log, fix it, then press Save & reload. My script's windows flicker. Drawing is skipped for a frame while a script's loop is busy, for example waiting for a model to load. Avoid long waits inside loops that run constantly. attempt to yield across C-call boundary You called script.sleep or script.yield outside script.register_looped / script.run_in_fiber. ImGui.Button can only be called from raiden.on_draw Move the ImGui code into a draw callback. See Custom windows. My window and options appear twice, or actions run twice. You pressed Run more than once. Press Reload to clear copies started with Run. My options are still listed after I deleted the script. Options stay until you restart the game. They do nothing without the script. Edits to a running script aren't taking effect. Press Save & reload. Save alone doesn't restart it. unexpected symbol near '&', '|', '~', '/' or '<' The script probably uses Lua 5.3/5.4 syntax and translation is off. Set 5.1 compat to Auto (detect) and press Reload. If the error remains, the script has a real syntax error on that line. A YimMenu script loaded, but I can't find its menu. Scroll to the Script tabs panel at the bottom of Misc → Lua Scripts and expand the script's tab. Scripts that draw their own window instead may need a hotkey or a setting to open it. Check the script's readme. A YimMenu script's folder loads the wrong files, or loads files twice. When a folder has no <FolderName>.lua, main.lua or init.lua, Raiden runs every .lua file directly inside it. Keep only the script's real starting file at the top of the folder, and its modules in subfolders. #Known issues As of September 2026: players.get_all() returns Player objects, not player ids. Call :get_id() on each one if you need the id. menu_event.ChatMessageReceived never fires. Scripted game events only arrive on GTA V Enhanced. On Legacy, menu_event.ScriptedGameEventReceived and "scripted_game_event" handlers never run. YimMenu tabs are only shown in Misc → Lua Scripts. A YimMenu script's gui.add_tab controls don't get their own page in Raiden's menu. Look in the Script tabs panel.