YaSpeakerComponent
The
YaSpeakerComponent allows creators to make non-player characters (NPCs) speakable so that players can talk to NPCs using the preset dialogues. Dialogues are displayed when the NPC is interacted with players. You can only apply this API to a speaker. A speaker is a non-player character (NPC) with a Dialogue component.Functions
number AddCommonDialog(number dialogID, [number triggerDialogID])
SERVER ONLY
Adds a dialogue that is open for all players to the speaker. The dialogue is activated by adding it to the speaker. The dialogSN will be returned by default.
dialogIDThe unique identifier of the dialogue.triggerDialogIDThe triggerDialogID is used to group UI dialogues.
number AddCommonQuestDialog(number dialogID, number questID, [number triggerDialogID])
SERVER ONLY
Adds an interactable dialogue that is open for all characters to the speaker. The dialogue is activated by adding it to the speaker.
dialogIDThe unique identifier of the dialoguequestIDA unique identifier for the quest.triggerDialogIDThe triggerDialogID is used to group UI dialogues.
boolean ContainsCommonDialog(number dialogID, [number dialogSN])
Returns true if the current dialogue is contained in the list of the speaker's generic dialogues. Generic dialogues can be interacted with all players.
dialogIDThe unique identifier of the dialoguedialogSNThe serial number of the dialogue
boolean RemoveCommonDialog(number dialogID, number dialogSN)
SERVER ONLY
Removes the speaker's generic dialogues.
dialogIDThe unique identifier of the dialoguedialogSNThe serial number of the dialogue