I am wondering how i can detect if a player talked with a npc using the dialogue, for context i am creating a shop that uses dialogue to buy the items.
If you are using Dialogue, you can use the event DialogChoiceSelected. This event detects whenever one of the dialogue choices has been selected in a dialogue.
For example, I have placed a TestDummy and have placed a Dialogue Onto It's Head, Then Inside the Dialogue, I have placed 3 Dialogue Choices.
I then created a local script and placed it onto StarterCharacter(this event only works locally).
local Dialogue = workspace.Dummy.Head.Dialog Dialogue.DialogChoiceSelected:Connect(function(player, dialogueInstance) print(player, dialogueInstance) --It has default params that gives you whoever triggered it and the dialogue choice, --Do whatever you want here. end)
Whenever one of the dialogue choices have been selected by the player, this event will trigger.
Note: Dialogue and DialogueChoices are two different things, DialogueChoices should be placed inside Dialogue.
If you want to read more about it, here is the link to the documentation. https://developer.roblox.com/en-us/api-reference/event/Dialog/DialogChoiceSelected