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
#2
Nice! I've messed around with custom methods once or twice, but you actually made something useful! Cool.
Reply
#3
Thanks.
Reply
#4
I found a typo in your comment though.

Properties. Not perporties.
Reply
#5
I'm horrible at spelling.
Finished the In-Death.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)