Garry's Mod Wiki

Garry's Mod Wiki

  table table.Copy( table originalTable )

Description

Creates a deep copy and returns that copy.

This function is very slow! If you know the table structure, it is better to write your own copying mechanism
This function does NOT copy userdata, such as Vectors and Angles!

Arguments

1 table originalTable
The table to be copied.

Returns

1 table
A deep copy of the original table

Example

Creates a deep copy of table Fruit

local Fruit = {"Orange", "Apple", "Banana"} local FruitCopy = table.Copy(Fruit) PrintTable(FruitCopy)
Output:
1 Orange 2 Apple 3 Banana

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...