Dialogs with a character, camera paths
lua
-- The camera turns to the NPC's face, its name and what it says at the bottom of
-- the screen, the answers (click, keys 1-9, arrows + Enter; Escape closes).
local choice = RLX.OpenDialog(source, {
ped = "mechanic", -- an RLX.AddPed id (or netId = n); its data.name is the title
title = "Mechanic", text = "What can I do for you?",
options = { { label = "Repair my car", value = "repair", icon = "car" }, { label = "Nothing" } },
}) -- "repair", 2 (no value: its number), or nil
-- Talk to one NPC only, with the target (Alt):
RLX.AddTarget({ id = "talk_mechanic", ped = "mechanic", label = "Talk", icon = "user" }, function(source)
lsmp.createThread(function() local c = RLX.OpenDialog(source, { ped = "mechanic", text = "..." }) end)
end)
-- A camera path (intro, a property tour, a cutscene): waits until it ends.
local res = RLX.PlayCamera(source, {
points = {
{ coords = { x = -75.0, y = -820.0, z = 330.0 }, lookAt = { x = -75.0, y = -820.0, z = 300.0 }, fov = 50, duration = 3000 },
{ coords = { x = -10.0, y = -760.0, z = 340.0 }, rotation = { x = -20.0, y = 0.0, z = 120.0 }, duration = 6000 },
},
blend = 800, ease = true, skip = true, hideHud = true,
}) -- true, "skipped" (Backspace) or falseOn the client: RLX.OpenDialog({ entity = handle, ... }), RLX.PlayCamera(def), RLX.StopCamera(), RLX.ShowCountdown(def). The example resource rlx_basics has all of it in one NPC: /guidedemo (server/guide.lua).