Discord
Login
Community
DARK THEME

Class and later an object?, Explain to me

Can someone explain to me how to make a class from a block and then create some objects from that class?

Um…

person = class
  constructor = function(name, age)
     this.name = name
     this.age = age
  end
end

init = function()
  person1 = new person(“Gorgojo”, 29)
  print(person1) // This should return an object
end

An example

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community