You can’t do a multiline string that way. Using the double brackets is a string literal and allows for any literal interpretation of string characters as well as multi-line strings without escaping.
Unfortunately, it is still the same by using [[]], which is a multiline string. The variable you tried to assign will always error because the computer thinks it’s an unfinished string.
I guess this is the issue. ModuleScripts are limited to one value return. No more than that. If you really want to send both in one, then you should wrap it in an anonymous table and then use unpack() when required.
Alternatively, you could assign that to a module variable and read the variable from the other script.
local instructions = [[
class Window [
Table flags -> default location for values
Method Section(name)
@name -> text for the Section
Method Label(name)
@name -> text for the label
return -> [
Method Set(string) -> sets the label text
label object (Instance)
]
Method Toggle(name, options, callback)
@name -> text for toggle
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
@callback -> function to call when toggle is changed
return -> [
Method Set(number) -> sets toggle value
]
Method Slider(name, options, callback)
@name -> text for slider
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
precise (boolean) -> wether to show full number or not -- e.g 0, 1 vs 0, 0.1, 0.2, ...
default (number) -> default slider value
min, max (number) -> self explanatory
@callback(value) -> function to call when slider is changed
return -> [
Method Set(number) -> sets slider value
]
Method Dropdown(name, options, callback)
@name -> text for dropdown
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
list -> list of objects to display
@callback(new) -> function to call when dropdown is changed
return -> [
Method Refresh(array) -> resets dropdown.list and sets value to first value in array
]
Method Button(name, callback)
@name -> text for button
@callback -> function to call when button is clicked
return -> [
Method Fire(<void>) -> calls callback
]
Method Bind(name, options, callback)
@name -> text for keybind
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
kbonly (bool) -> keyboard keys only (no mouse)
default (EnumItem) -> default key for bind;
@callback(key) -> function to call when bind is changed
Method Box(name, options, callback)
@name -> text for box
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
type (string) -> if type is "number", box will only accept numbers
min, max (number) -> used to define constraints when type is numbers only
@callback(box, new, old, enter) -> function to call when box is changed
box -> box object;
new -> new value;
old -> old value;
enter -> wether enter was pressed
returns -> box object (Instance)
Method SearchBox(name, options, callback)
@name -> text for searchbox
@options -> array
location (table) -> alternate table to put value in (default = window.flags)
flag (string) -> index for value (e.g location.farming)
autoupdate (boolean) -> will set itself depending on flag (default = false)
updatedelay (number) -> time to wait before checking if the flag has changed. Only works when autoupdate is true (default = 1)
list -> list of objects to search for
@callback(new) -> function to call when dropdown is changed
return -> [
Function (array) -> resets dropdown.list and sets value to first value in array
]
]
]]
For a module variable, use library.INSTRUCTIONS = "your string here". Your script can instantly access this variable through Module.INSTRUCTIONS, depending on variable to module.
Sadly, that’s the limitation of a ModuleScript being unable to return a tuple. Workarounds are about better than magic code(sometimes not). If it gets the job done(without indicating any signs of breaking after the long run), there shouldn’t be an issue.
The purpose of a module is a reusable table that gets initialised once and referred to whenever you require the module. They aren’t created for the purpose of returning a string - as suggested above you should include instructions in your module rather than trying to make them separate.
It’s not about what’s “meh” or not, it’s understanding what a ModuleScript actually is, why it was created, what it’s for, and its limitations.
Modules are not roblox-specific, so if you want more information and why modules are a single table that acts as a namespace for all the variables and functions you want to be accessible, you can Google modules in Lua.