![]() Hopefully that helps a bit with understanding the basic powers of Module Scripting with variables. Print(ModuleName.IsVariableAbove()) - prints true Print(ModuleName.GetText()) - prints This is some set text ModuleName.SetText("This is some set text") Print (ModuleName.GetText()) - prints This is some text What are Module Scripts Roblox Scripting Explained GnomeCode 75K subscribers Subscribe 1.7K Share 52K views 1 year ago Advanced Scripting Tutorials Confused about module scripts Look no. local ModuleName = require(PathTo.ModuleName) Now that you have included these two functions as part of the Module Scripts table, you can do the following in another script. Local VariableNotInModuleNameTable = "This is some text" However, there are ways to “set” or “get” those local variables from the outside source requiring it. They are considered local to the Module Script itself. ![]() Print(ModuleName.SomeVariable) - prints "Some Value"īecause local variables are not included directly in the table, they don’t get the same privilege. ![]() So in some other script somewhere, local ModuleName = require(PathTo.ModuleName)Īt this point, you can access whatever is returned from the Module Script, which consequentially is pointed to by the variable above. ![]() In most cases it is the Module Script table that is returned. There won’t be a difference in where you place the local variables.Ī Module Script has to return something, it doesn’t however have to return everything. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |