Usage
Basic Dialog Structure
local dialogData = {
id = "example_dialog", -- Unique dialog identifier
title = "NPC Name", -- NPC's name
role = "NPC Role", -- NPC's role/occupation
roleColor = "#ff000077", -- Role badge color
roleBorderColor = "#ff0000", -- Role badge border color
text = "Welcome message", -- Initial greeting text
ped = ped, -- NPC entity object
options = {
{
title = "Option 1", -- Dialog option title
description = "Option 1 description", -- Brief description
text = "NPC response text", -- Text shown when option is selected
onSelect = function()
-- Code executed when option is selected
end,
next = { -- Sub-menu options
{
title = "Sub-option 1",
description = "Sub-option 1 description",
text = "Response for sub-option 1",
onSelect = function()
-- Code executed when sub-option is selected
end,
close = true -- Closes dialog when selected and typing text will be end
}
}
}
}
}Properties
Option Properties
Example Usage
Exports
CreateDialog
ShowDialog
RemoveDialog
Last updated