shadmar Posted March 2, 2014 Share Posted March 2, 2014 function Script:Howdy(one,two,three,four) System:Print(one) System:Print(two) System:Print(three) System:Print(four) end function Script:Start() self.Howdy(1,2,3,4) end prints out : 2 3 4 0x00000000 HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rick Posted March 2, 2014 Share Posted March 2, 2014 When calling "class" functions you want to use : not . so make it self:Howdy(1, 2, 3, 4) When you use : behind the scenes Lua automatically passes the calling object as the first hidden parameter giving it the name 'self' which is why we can use self.variable inside these "class" functions. If you really wanted to use . (dot) (which I wouldn't recommend) then you would have to pass the object yourself like: function Script:Howdy(self, one, two, three, four) end self.Howdy(self, 1, 2, 3, 4) 2 Link to comment Share on other sites More sharing options...
shadmar Posted March 2, 2014 Author Share Posted March 2, 2014 Thanks, I thought I was crazy.. HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted March 3, 2014 Share Posted March 3, 2014 Thanks, I thought I was crazy.. You may still be. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts