RbxLibrary

From Legacy Roblox Wiki
Revision as of 03:13, 19 January 2012 by >JulienDethurens (Created page with "{{Stub}} == What is a library? == In Roblox, the term '''library''' doesn't mean "an educational, academical place to gain informational knowledge." Rather, libraries i...")
Jump to navigationJump to search
Stub icon Stub
This article is a stub. If you think you know more about this than we do, please help us by contacting a writer.
Thank you!


What is a library?

In Roblox, the term library doesn't mean "an educational, academical place to gain informational knowledge." Rather, libraries in Roblox are simply extensions of the API, which include developer-created Lua code which can be included in any script with ease.

How do I use a library?

To find out what methods are in the library, you can first check for documentation on the wiki, or search the forums. If they both come up with nothing, you'll probably need to do lots of experimenting. Here's some base code to use:

LoadLibrary("RbxGui")

That loads the contents of RbxGui, a library. However, we need to store it in a variable.

local RbxGui = LoadLibrary("RbxGui")

Now, to see the contents, we can use a simple loop, with the handy GetApi method:

for key, val in pairs(RbxGui:GetApi()) do
    print(key .. " = " .. val)
end

That will print pretty much everything in the table out for us, so we know at least what there is in there.

What libraries currently exist?