You’re looking for the #development-support:code-review category.
I skimmed over your code and I notice a lack of abstraction in a lot of areas where it would be helpful. There’s lots of hard-coding and your system seems to lack support for an arbitrary number of dialogue options.
On that note, are you making an NPC dialogue system? You can probably borrow some tidbits from the Roblox Dialogue Editor, since it’s designed to hold dialogue trees and mapping. It is highly customisable and contains a lot of what you could want in for dialogue management.
The project is not actively maintained however and it seems like it’s been dropped, so you’ll have to look to supported alternatives being maintained by the community. The original code is still salvageable nonetheless.