I normally like to stick to languages like Java and and Javascript and I know that creating a class in Javascript is
class Car {
type;
year;
constructor(type, year) {
this.type = type;
this.year = year;
}
}
And java this
File: Car.java
public class Car {
String type;
int year;
public Car(String type, int year) {
this.type = type;
this.year = year;
}
}
And for making a new object it’s as easy is as this
Java: Car test = new Car("Car", 2005);
JavaScript: let test = new Car("Car", 2005);
My main question is that how can I create a simple class like the one I showed above and how can I make a new Instance of it in LUA? I’m thinking of making some sort of ticket system, and I think that using objects would be more clean then using variables