From ComputerCraft
Jump to navigation Jump to search
Returns table vector
API vector
Source CC:Tweaked (source)

Given three coordinates, x, y, and z, this function will create a new vector when called. If an argument is not a number and cannot be converted to a number the corresponding coordinate will default to zero.

ExampleExampleCreating a vector
Creates a new vector and prints the components.
local myVector =, 71, -3040)
print("My vector has the components:", myVector.x, myVector.y, myVector.z)
Output My vector has the components: 240 71 -3040
ExampleExampleLocating self
Acquiring the executing computer's own location and printing it on screen.
local location =
print("Current location is:", location)
Output Current location is: 38 65 392