Client
CreateNPC
Creates new NPC.
exports['rip_dialog']:CreateNPC(name, model, position, info, options)
name:
string
The name of the npc , this has to be unique so it doesn't mess up with other NPCS.model:
string
The NPC model, you can find all NPC models here.position:
vector4
The coordinates of the NPC location.info:
table
The menu information you can find the info options here.options:
table
The menu options you can find the menu options here.
Examples
exports['rip_dialog']:CreateNPC("testnpc", "a_m_m_hillbilly_01", vector4(2768.531, 1391.26, 24.52, 82.20), {
label = "Talk",
icon = "fas fa-user",
title = "Farmer Shop",
content = "Hello! How can i help you sir?"
}, {
options = {
{
icon = "fas fa-seedling",
label = "I want to buy plant tools",
params = {
type = "action",
event = function()
exports.ox_inventory:openInventory('shop', {type = 'farmer'})
end,
args = {}
}
},
{
icon = "fas fa-angle-right",
label = "i'm just looking around"
},
},
})
ChangeNpcOptions
Changes an existed NBC menu.
exports['rip_dialog']:ChangeNpcOptions(name, info, options)
name:
string
The name of the NPC that you want to change the options for.info:
table
The menu information you can find the info options here.options:
table
The menu options you can find the menu options here.
Examples
exports['rip_dialog']:ChangeNpcOptions("testnpc", {
label = "Talk",
icon = "fas fa-user",
title = "Farmer Shop",
content = "Sorry i can't help you now try later."
}, {
options = {
{
icon = "fas fa-cannabis",
label = "okay i will try later",
params = {
type = "action",
event = function()
print('This was called by the first option')
end,
args = {}
}
},
},
})
DeleteNpc
Deletes an existed NBC.
exports['rip_dialog']:DeleteNpc(name)
name:
string
The name of the NPC that you want to delete
Example
exports['rip_dialog']:DeleteNpc('testnpc')
openMenu
Opens a new menu, you can use it to open a new NPC menu that have other options from the original NPC menu, or you can use it to open the menu without NPC.
exports['rip_dialog']:openMenu(info, options)
info:
table
The menu information you can find the info options hereoptions:
table
The menu options you can find the menu options here
Examples
exports['rip_dialog']:openMenu({
title = "Title Name",
content = "What did you have in mind?",
invisible = false
}, {
options = {
{
icon = "fas fa-angle-right",
label = "menu option label",
params = {
type = "client",
event = "client:testButton",
args = {}
}
},
},
})
closeMenu
Closes the menu, (you don't need that because the menu will close automatically when you choose an option, but i add it just in case you needed it)
exports['rip_dialog']:closeMenu()
Last updated