Skip to content

Reference

Interface: menus, inputs, progress ​

On the client, or from the server with the source first. These functions wait for the player's answer: call them in a handler or a thread.

lua
-- Menu (keyboard ↑ ↓ Enter Backspace, or mouse; submenus)
local choice = RLX.OpenMenu(source, {
  title = "Garage", subtitle = "Pillbox",
  items = {
    { label = "Take out a vehicle", value = "out", description = "..." },
    { label = "Store", value = "store", rightLabel = "free" },
    { label = "Options", submenu = { title = "Options", items = { { label = "Rename", value = "rename" } } } },
    { label = "Closed", disabled = true },
  },
  -- keepInput (default true, UIConfig.menusKeepControl): the player keeps the
  -- game (walking, driving, looking around); the menu is driven with the arrows,
  -- Enter and Backspace or Escape. keepInput = false: mouse and keyboard.
})

-- Input: text, number, password, textarea, select, checkbox
local values = RLX.Input(source, {
  title = "Transfer",
  fields = {
    { name = "amount", label = "Amount", type = "number", min = 1, max = 100000, required = true },
    { name = "account", label = "From", type = "select", options = { { label = "Bank", value = "bank" }, { label = "Cash", value = "money" } } },
    { name = "note", label = "Reason", type = "textarea" },
  },
})   -- { amount = 250, account = "bank", note = "..." } or nil

local ok = RLX.Confirm(source, { title = "Sell?", text = "For 500 $" })

-- Progress: animation (or scenario), objects in the hand (seen by everyone), blocked controls, X to cancel.
-- Cancelled too by death or a fall. -> true (finished) | false (cancelled)
if RLX.ProgressBar(source, {
  label = "Taking notes", duration = 5000,
  anim = { dict = "missfam4", clip = "base", flag = 49 },          -- or scenario = "WORLD_HUMAN_CLIPBOARD"
  prop = { model = "p_amb_clipboard_01", bone = 36029, offset = { x = 0.16, y = 0.08, z = 0.1 }, rotation = { x = -130.0, y = -50.0, z = 0.0 } },
  disable = { move = true, car = true, combat = true }, canCancel = true,
}) then ... end

RLX.ShowTextUI(source, "[E] Open")   -- on the client: RLX.ShowTextUI("[E] Open")

-- Skill check (lockpick, crafting, hacking): one entry per round; the key changes at random among keys.
if RLX.SkillCheck(source, { difficulty = { "easy", "medium", "hard" }, keys = { "E", "Q" } }) then ... end

-- Radial menu around the screen center (mouse), with submenus and icons.
local choice = RLX.OpenRadial(source, { title = "Actions", items = {
  { label = "Hands up", value = "handsup", icon = "hand" },
  { label = "Vehicle", icon = "car", items = { { label = "Lock", value = "lock", icon = "key" } } },
} })

-- Notification with a title and an icon (info, check, alert, x, police, ems, money, car, phone, user, star, hand, box, key, map, gear).
RLX.Notify(source, { title = "Bank", text = "Transfer received: 500 $", kind = "success", icon = "money", duration = 6000 })

-- A timer at the top of the screen (-1: everyone), and GTA's big message.
RLX.ShowTimer(source, { id = "heist", label = "Vault", seconds = 90 })   RLX.HideTimer(source, "heist")
RLX.ShowBigMessage(-1, { title = "HEIST", text = "Fleeca Bank, Route 68", duration = 5000 })
RLX.HideTextUI(source)

On-screen help (ShowTextUI, interaction points) uses GTA's own help box by default (Config.TextUI = "game"): the [E] of a point becomes the game's key icon, from the player's keyboard. Config.TextUI = "ui" uses the rlx_ui page instead.