
The Lua Logo.

What the scripting/items/models look like for old Lua items.
On Roblox, Lua (commonly RBX.lua) refers to the engine's implementation of the Lua programming language. Lua is primarily used in scripts that change the behavior of the server and the client, and is also used in other programs such as plugins which extend the functionality of Roblox Studio. With focus on game development, Roblox modified its implementation of Lua, introducing new data types and removal/changes of standard Lua libraries. Roblox uses its own dialect of Lua, known as Luau, which is derived from Lua 5.1.4 with many changes including performance optimizations and gradual typing.
History[]
Roblox previously supported execution of Lua bytecode through the standard Lua library function loadstring. On August 3, 2012, Roblox stopped supporting this method of execution for security and version compatibility reasons.[1]
On August 27, 2019, Roblox would switch its scripting language from Lua 5.1.4 to Luau.[2]
Implementation[]
To be suitable for game development on Roblox, Roblox's implementation of Lua has had some changes, primarily dealing with the standard Lua libraries.
Many functions as well as some libraries were excluded (accessing them will result in nil):
io
andpackage
libraries were excluded.- Most
debug
andos
library functions were excluded, specifically:- All other functions in the
debug
library (except fordebug.traceback
) debug.getinfo
(Roblox uses a similar functiondebug.info
)os.execute
os.exit
os.getenv
os.remove
os.rename
os.setlocale
os.tmpname
- All other functions in the
Roblox also introduced its own data types to the implementation, including instances.
Execution[]
There are many ways Lua code can be run in the Roblox's engine:
- Scripts, which are executed automatically based on their conditions.
- Using the command bar in Roblox Studio or in the Developer Console.
- A file selected through the Run Script button in Roblox Studio.
Trivia[]
This section is a trivia section. Please relocate any relevant information into other sections of the article.
- There is an asset type (ID 5) for assets containing Lua code.
See also[]
References[]
- ↑ Shedletsky, John (2012, August 3). "Bye Bye Bytecode". From Roblox Blog. Accessed February 10, 2023. Archived from the original on January 16, 2022.
- ↑ Kapoulkine, Arseny (2019, August 27). "Faster Lua VM Released". From DevForum. Accessed February 10, 2023. Archived from the original on December 17, 2022.
Programming |
| ||||||
---|---|---|---|---|---|---|---|
Design | |||||||
Assets | |||||||
Tools | |||||||
Monetization | |||||||
Analytics | Developer Stats · Monthly active users (MAU) | ||||||
Advertising | |||||||
Resources |
Corporate | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Software |
| ||||||||||||||||||
History | |||||||||||||||||||
Website |
Account settings · Avatar Editor · Banner · Character · Comments · Community · Discover · Error · Friends · Inventory · Messages · My Feed · My Transactions · Notify · Personal Server · Private server · Profile · Roblox badge · Website Chat · Website Background | ||||||||||||||||||
Currency | |||||||||||||||||||
Membership | |||||||||||||||||||
Merchandise | |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
Italicized links indicate pages with a discontinued subject. |