How can I run events/scripts during dialog?

Hello, I am trying to find a way to run events during dialog, for example when the character says “I’ll follow you” I want to be able to trigger an event that actually lets them follow you. Or when you say “whats that in the sky” have something fall out of the sky.

I am currently using this to make my dialog (Glossy's Dialog Editor Fork - Roblox) but I am willing to change what I am using. Please let me know if you have any qustions.

You should really try to make your own dialog GUI or anything like that - it gets fun and it gets more possibilities since you’ll know how to customize it (because, obviously, you scripted it).

1 Like

Elaborate on what you mean by dialog. Do you mean a character talking with no pauses, or would it be like you also speaking with the character.

Like when the character speaks and then you respond and the character speaks some more

Have you considered reading the code to see where the end of the dialog triggered? I mean, usually, you could do something like wait(2) then write code for the NPC to follow you.

Yikes. that looks complex! I suppose I’ll just write my own dialog system. I actually have read it before by the way I just didnt understand it

It’s really not that complex at all.

If you read into the code of your NPC, when the dialog fires and you interact with the NPC, all you’d have to do is write your code right below the dialog.

1 Like

I’ll show you my “Dynamic text functions” script

--this is a table of named functions that replace text dynamically in prompt or response contents
--whenever the dialogue system encounters a text like <SomeNameHere>, it will replace that text
--with a function from this table with the same name (SomeNameHere). So, for example, if you have
--a prompt that says "Hello, <PlayerName>! How is your family?" The dialogue system would automatically
--detect the <PlayerName>, call the function PlayerName below, and replace the text with whatever
--the function returns. So, if Telamon was speaking to this NPC, the text would read
--"Hello, Telamon! How is your family?"

--the player is the player talking to the npc
--the dialogueFolder is the folder in the Roblox object hierarchy that represents this conversation
--the node is the node that is calling this function

return {
	PlayerName = function(player, dialogueFolder, node)
		return player.Name
	end,


	Test = game.Workspace.Goo.Transparency == 0
}

The PlayerName works but I try adding Test it does this

Chief I’m pretty sure that’s a ModuleScript. Is there any core script where it branches off of?