LoadLibrary (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>JulienDethurens
No edit summary
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
Tags: mobile web edit mobile edit
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>{{Function
<onlyinclude>{{Function
|name = LoadLibrary
|name = LoadLibrary
|arguments = [[string]] <var>library</var>
|arguments = {{type|string}} <var>library</var>
|returns = [[RbxLibrary]]
|returns = {{type|RbxLibrary}}
|description = Loads a library and returns it. If <var>library</var> is not the name of a valid library, [[false]] is returned, as well as an error message.
|description = Loads a library and returns it. If <var>library</var> is not the name of a valid library, {{false}} is returned, as well as an error message.
}}</onlyinclude>
}}</onlyinclude>


Line 12: Line 12:
This code would load the [[RbxGui (Library)|RbxGui]] library and store it in the variable <var>RbxGui</var>:
This code would load the [[RbxGui (Library)|RbxGui]] library and store it in the variable <var>RbxGui</var>:


<code lua>
<syntaxhighlight lang="lua">
local RbxGui = assert(LoadLibrary('RbxGui'))
local RbxGui = assert(LoadLibrary('RbxGui'))
</code>
</syntaxhighlight>


==See Also==
==See Also==

Latest revision as of 05:29, 27 April 2023

LoadLibrary( string library )
Returns RbxLibrary
Description: Loads a library and returns it. If library is not the name of a valid library, false is returned, as well as an error message.


Example

This code would load the RbxGui library and store it in the variable RbxGui:

local RbxGui = assert(LoadLibrary('RbxGui'))

See Also