Jump to content

Luau (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Hangshangs (talk | contribs) at 16:15, 3 August 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Luau is a Programming Language based on Lua and developed by Roblox Cooperation and used in Roblox Studio to create games on Roblox.

Examples

Luau's Logo

Here's an example code for spawning a "Part" (Roblox Block instance, shown here as "brick") every 10 second. Spawning in the position 0, 0, 0. "game" refers to the game itself. "Workspace" is where the player can interact, a 3D environment. "CFrame" is used as the position of "brick".

while wait(10) do
    local brick = instance.new("Part")
    brick.parent = game.Workspace
    brick.position = CFrame.new(0, 0, 0)
end


Note that "Workspace" is a child of "game". This script is a "Script" instance and it's placed in "ServerScriptService", a parent of "game".

See Also