- Joined
- Dec 26, 2013
- Messages
- 1,628
- Solutions
- 11
- Reaction score
- 869
Ok so my question is aimed at 1.4 and up, for lua, I know we can extend the classes provided for us, with our own custom functions like
I have used this many times and its great, but what I was curious of, is there a way to create new variables for the class as well?
something like
and then be able to use and manipulate the data like so
Is there any way to do this without having to create a new sub-class of the original class?
My question is intended for all the variable types, string, number, boolean, and table.
If this is easily possible, could someone please provide a small example sample for me of each type?
Lua:
function Player.isUsingOtClient(self)
I have used this many times and its great, but what I was curious of, is there a way to create new variables for the class as well?
something like
Lua:
Monster.Level = 0
and then be able to use and manipulate the data like so
Lua:
function Monster.getLevel(self)
return self.Level
end
Is there any way to do this without having to create a new sub-class of the original class?
My question is intended for all the variable types, string, number, boolean, and table.
If this is easily possible, could someone please provide a small example sample for me of each type?