Constructors

From Legacy Roblox Wiki
Revision as of 14:31, 23 December 2010 by >TaslemGuy (Created the page. Please improve. Might not be to Wiki standard.)
Jump to navigationJump to search

Introduction

Constructors are functions which create an instance of data or a value of a specific type. While some functions may return a specific data type, for instance, a Vector3, they are not considered a Constructor because they needed to call a constructor to make the value.

function a(x,y)
return Vector3.new(x.x,y.y,0) --A constructor is called here.
end 

Examples

Vector3.new(x,y,z)
Instance.new(n)
CFrame.Angles(a,b,c)