I want to make custom global functions I can use in studio, and so far the best way to do this I've found so far is if I create my own library. However, I do not know how, so could someone elaborate on how libraries function and how I could create and implement my own?
COMMUNITY QUESTION
Making Custom Libraries?
1 answer
This is where ModuleScripts come in, ModuleScript will work for you as a Library of values, userdata, tables, and functions anywhere anytime you want.
First you Insert a ModuleScript, add it anywhere you want, I usually add mine in ReplicatedStorage. Name it, then in it, you gotta make a table, then return the table, and do your functions in it or by using function TableName.FunctionName() end.
ModuleScript
local Lib={}
function Lib.Print(Text) print(Text) end
return Lib
Script or LocalScript
local Lib=require(YourModuleScriptScopeLocation)
Lib.Print("Sup")
Sup
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
I've tried that before in studio, but it didn't seem to work well. The script wouldn't return a function and it would result in an error.
I tried it again. It returns a nil value.
The problem with using a method like this is I can't run the script in the studio without launching a test.
Hold on just a moment...
To use in studio add the "Script or LocalScript" section to the COMMANDBAR.
Well yeah, but I can't reference it easily. It's not efficient that way.
dont use . use : on line 2 in script/localspript and on line 3 in ModuleScript