search/
Start typing to search packages!
package_2
lucid
By @bigfootpp
Roblox
MirroredLuCid
LuCid is a lightweight Luau package designed to simplify Object-Oriented Programming (OOP) in Roblox.
[!WARNING] This project is currently in Beta. Expect breaking changes and use with caution.
Installation
Wally
LuCid = "bigfootpp/lucid@0.5.2"
Quick Start
local class = require(path.to.lucid)
local Character = class() { Health = 100 } {
__init = function(self, name: string)
self.Name = name
end,
TakeDamage = function(self, amount: number)
self.Health = math.max(0, self.Health - amount)
end
}
local hero = Character:create("Explorer")
hero:TakeDamage(25)
Inheritance
local Animal = class() { species = "" } {
speak = function(self)
return ("The %s makes a sound"):format(self.species)
end,
}
local Cat = class(Animal) { tail = true } {
speak = function(self)
return ("The %s meows"):format(self.species)
end,
}
super()
Call a parent method from a child override:
local Base = class() { health = 100 } {
getHealth = function(self)
return self.health
end,
}
local Tank = class(Base) { armor = 50 } {
getHealth = function(self)
return self:super():getHealth() + self.armor
end,
}
Chained super() calls work across multiple levels:
-- A -> B -> C
-- C:foo() calls super() -> B:foo() calls super() -> A:foo()
Limitations
super()must be called inside a class method. Calling it directly in atask.spawnortask.delaycallback will error.- A class method using
super()can be called fromtask.spawn-- only baresuper()calls outside of method dispatch are invalid. obj.method == obj.methodisfalse-- each access returns a new wrapper.
License
MIT License. See LICENSE.
Package Details
Install command (Click to copy)
Version
0.5.2
License
MIT
Safe for commercial use
Automated license review — not legal advice.
