Making npc speak the scripted dialog

I want to make the boss NPC, but that will taunt the player through out the fight
I have these 2 set up then I got stuck

Some word of advice please where should I go from here??
I have never used Modulescript, and I want to try using one to organize my code.

Dialog box controller (localscript)
local TweenService = game:GetService("TweenService")

local Box = script.Parent.Frame.DialogueBox

local ChangeDialogEvent = game:GetService("ReplicatedStorage").Events.ChangeDialog

ChangeDialogEvent.OnClientEvent:Connect(function(Data)
	
end)
Data (ModuleScript)
local Data = {
	Traits = {
		HasSecondPhase = true
	},
	dialogs = {
		FirstPhaseintro = {
			"Hello",
			"actually",
			"This is the intro dialog test"
		},
		SecondPhaseIntro = { 
			"Ok",
			"Now I'm mad",
			"Like for real"
		},
		RandomDialogs = { -- this will be chosen randomly through out the fight
			"EEEEEEEEE",
			"AAAAAAAAA",
			"WAAAAAAAAh"
		}
	}
}

return Data
2 Likes

This is a question you ask your self. Please look at these resources:

  1. How to Use Modules
  2. Practical use of Modules
  3. Dialogue System Post (Conversation)
  4. Simple Video on making a basic Dialogue System

If you still feel quite lost with these please reply again.

2 Likes

use require(modulescript) in any script to access the data table that you made in the module

1 Like

I’ll be studying all of these thank you for the source

2 Likes