Syntax
table.move(source, first, last, destinationStart, destination)Examples
Luau table slice copying
Run as a standalone current Luau script, or as a Script in Roblox Studio ServerScriptService. No Roblox engine APIs are required; type-annotated syntax is not standard Lua.
local source = {"a", "b", "c", "d"}
local page = {}
table.move(source, 2, 3, 1, page)
print(table.concat(page, ","))
print(table.concat(source, ","))- Output: b,c then a,b,c,d. The source is unchanged because a separate destination was supplied.
Best practices
- Validate source and destination bounds. Nested table values are shared references rather than deep copies.
Runtime & versions
Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Luau documentation