LeCC

Members
  • Content count

    1
  • Joined

  • Last visited

About LeCC

  • Rank
    Clan trial scripter

Profile Information

  • Gender
    Female

Recent Profile Visitors

375 profile views
  1. LeCC

    [Tutorial] Make more Object-Oriented scripts

    The way you use is simply using functions inside a table. It could be considered OOP, but using metatables is the official way in Lua. Also, your table is a local variable, just to point out. An example of using metatable method: a = {} a_mt = {__index = a} function a:create(test) local b = {} b.text = test return setmetatable(b,a_mt) end function a:give() return self.text end local c = a:create("Hey") c:give() -- This returns the string "Hey" As you can see, in this method you are able to use variable:functionname(), unlike yours. While both are fine, I personally recommend this one. //Edit: To be fair, I don't know which is the official one. For me it seemed this one, but I don't know.