Welcome to the official documentation for RoClass, a lightweight OOP library for Roblox.
Copy the RoClass .rbxm file into your ReplicatedStorage:
local RoClass = require(pathToRoClass)
Start creating classes, adding properties, using events, and applying mixins:
local Player = RoClass.new("Player")
:constructor(function(self)
self.Health = 100
end)
:method("TakeDamage", function(self, dmg)
self.Health -= dmg
end)
:build()
local p1 = Player.new()
p1:TakeDamage(20)
print(p1.Health) -- 80