Right now I’m making a game somewhat similar to “doors”, but the game has a narrative in the process
That is, the player enters a section, and the “narrator” says something, depending on what kind of room it is (an ordinary room with nothing special, just a random phrase from the list, or a room with some entertainment, such as choosing where to go, there is a different set of possible phrases, designed specifically for this room)
the problem is that I have no idea how to implement it, where to store the texts and how to access them
One of the ideas is to put a trigger in each room that accesses one of the text files. in theory, this would work well, but special rooms create some problems, because for them I would have to create a lot of such files
I would be grateful if someone could suggest possible options for a more rational implementation of such a system
That is, I still need to create hitboxes with different names for special rooms and the same for typical rooms, and the modular script will find these names of hitboxes and output the necessary text?
you can use part.Touched to check whenever something touches the trigger.
then, you can use a remote event that with an argument (which would be the dialogue line)
local module = require(module)
trigger.Touched:Connect(function(touchedPart)
local plr = game.Players:GetPlayerFromCharacter(touchedParrt.Parent
if plr then
remoteEvent:FireClient(plr, module.DialogueLine)
so, I need to make a modular script that will store all the functions for a dialog (dialog appearance; its closing; choosing what text will be reproduced; etc.)
make a script for serverScriptService, which will react to the fact that the player interacted with the trigger, what its name is, and receive text from the modular script
and somehow from the script, using remote event, send the text received by the script to the interface?
I apologize if the questions are stupid, programming is hard for me