So i have an text value in RepStorage that updates the ui i also have a script in serverScriptService that changes the dialog i wanted to use a module script to change the text
i could not figure out to do it but heres my attampt
ServerScript
local RepStorage = game:GetService("ReplicatedStorage")
local DialogModule = require(script.DialogModule)
local TextValue = RepStorage:WaitForChild("Text")
TextValue.Value = DialogModule.Dialog[1]
wait(3)
TextValue.Value = DialogModule.Dialog[2]
Module Script
local DialogModule = {}
local Dialog = {
"Hello and welcome to the expirment",
"We will be asking some questions to see if youre a good test subject",
"Question 1 : What is your name?"
}
local CorrectName = {
"Alright thank you"
-- Enterd name -- "Thats Correct?"
}
local Wrongname = {
"Why are u lying to me",
"Take him away"
}
local Dialog2 = {
"Alright Second Question",
"Are u scared?"
}
local Question2Yes = {
"Dont Worry u dont have to be",
}
local Question2No = {
"Well u should be",
}
local Dialog3 = {
"Question 3 : Do u know where you are?"
}
local Question3Yes = {
"Not a valid answer let me ask you again"
}
local Question3No = {
"Alright",
"You seem to be a valid test subject please follow me"
}
return DialogModule

2 comments
but if i wanted to put more dialog in 1 table how would i do this?
I edited my answer, look Dialog 1, you can do that as many time as you want, you access them by: DialogModule["Dialog 1"]["Sub dialog"].