@usbx/npc NPCs and their dialogue
local npc = require ("@usbx/npc" )Finds an NPC by its Script Name.
npc.find(script_name: string) ->
Npc ?
Use it for grabbing a shopkeeper or guide NPC by its Script Name so a script can control it.
script_nameScript Name of the NPC.
Every NPC of the place.
example
for _, guide in npc.all () do guide:say ("Hello!" ) end Use it for making every NPC react to the same event, like a new round starting.
npc. dialogue_signalevent # Fires when an NPC dialogue reaches a Send Signal node, with the NPC, the player and the name of the Dialogue Signal. The Signal with that name, if a script defines one, fires too.
example
npc.dialogue_signal :connect (function (speaker, player, name) print (speaker.display_name, player.name, name) end )Use it for giving a quest or opening a shop when a player reaches that point in an NPC's dialogue.