Custom Object Guide
#1
More information at http://buildism.net/wiki/w/index.php?tit...cts#Coding

[lua]
Int = {} --Yes, its a table
function Int:new(one, two, three) --here I set the properties.
newTB = {x, y, z}
newTB.x = one
newTB.y = two
newTB.z = three

return newTB
end

a = Int.new(5, 8, 1) --Here we are using Int the same as Vec2D.
print(a.x) --5
print(a.y) --8
print(a.z) -- 1
[/lua]

Look over it. Simple. I'm gussing this is the same way (for you ROBLOXians) Instance.new works.
Reply


Messages In This Thread
Custom Object Guide - by Dignity - 06-15-2011, 03:22 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)