Search
 
SCRIPT & CODE EXAMPLE
 

LUA

Lua OOP

-- assume the obj from last example
obj.inspect = function (self)
   print("A person: " .. self.name .. " of the age " .. self.age)
end

obj.hello = function (self) 
   print(self.name .. ": Hello! I'm " .. self.name)
end

obj.goodbye = function (self)
   print(self.name .. ": I must be going.")
end

-- now it receives the calling object as the first parameter
obj.inspect(obj) -- A person: John of age 20
obj.hello(obj) -- John: Hello! I'm John
obj.goodbye(obj) -- John: I must be going
Comment

Lua OOP

-- assume the obj from last example
obj.hello = function () 
   print("Hello!")
end

obj.goodbye = function ()
   print("I must be going.")
end

obj.hello()
obj.goodbye()
Comment

PREVIOUS NEXT
Code Example
Lua :: lua genetic algorithm 
Lua :: hello world in lua 
Lua :: how to kill humanoid with click detector roblox 
Lua :: lua string replace 
Lua :: how to make everyone on team see name roblox 
Lua :: FiveM Lua How to create table of all online player id 
Lua :: roblox script to create brick 
Lua :: lua input 
Lua :: Get Nearest Player fivem 
Lua :: gettable 
Lua :: lua coding lines to test with 
Lua :: genarating random number 
Lua :: lua text script 
Matlab :: matlab symbolic derivative 
Matlab :: matlab not less than 
Matlab :: print hello world n times in matlab 
Matlab :: geom_density_2d 
Basic :: pmatplotlib draw a square with a magenta dotted line and pentagon markersython matplotlib overlaped 
Basic :: API Key Authentication, Basic , Pasword Grant, Client Credentials 
Elixir :: elixir map 
Elixir :: phoenix ecto query expression 
Scala :: scala list get element 
Scala :: for scala example 
Actionscript :: vivo y11 not connecting to wifi after update 
Excel :: convert number to date in excel 
Perl :: perl sigils 
Pascal :: pascal input format check 
Powershell :: How to test HDD health in PowerShell 
Clojure :: Clojure whitespace 
Assembly :: ror loading webview: Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state.. 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =