How to make this module script look neat

is there a way to make this module script look neat at least?

local settings = {
	textDelay1 = 0.05,
	soundOn1 = 0.2,
	startEvent1 = false,
	eventPath1 = "",
	prompt1 = "Help me",
	option1Dialog1 = "Why",
	option1Dialog1GoTo = 2,
	option2Dialog1 = "Sure",
	option2Dialog1GoTo = 3,
	option3Dialog1 = "Bye noob",
	option3Dialog1GoTo = 4,
	
	startEvent2 = false,
	eventPath2 = "",
	prompt2 = "Yea, cool right?",
	
	startEvent3 = false,
	eventPath3 = "",
	prompt3 = "K",
	
	
	
	-- Option 4
		startEvent4 = false,
		eventPath4 = "",
		prompt4 = ""
	
}

return settings

Thanks!

I recommend changing this topic to the category #help-and-feedback:code-review since you are asking for organization on your code instead of help on a coding issue. But that’s just a suggestion.

You could create different tables for example; a table containing strings, a table containing booleans, and a table containing integers and a table containing floating point numbers:

local settings = {
    booleans = {
		-- Put your booleans in this table
	},

	strings = {
		-- Put your strings in this table
	},

	ints = {
		-- Put your integer numbers in this table
	},

	floats = {
		-- Put your floating pointnumbers in this table
	}
}

return settings
2 Likes

ohhh yeah i forgot to do that but thank you!! :grinning:

1 Like

Rather than grouping by types as suggested above (my personal advice: never do that, group by relevancy/system not by an abstract concept), quickly reading over your code shows that you’re trying to make a dialogue system. You should probably look into creating an actual deep dialogue system where your options can be represented in separate ModuleScripts or as Luau OOP objects.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.