How Starfall libraries work
⚡ Performance•Updated 2 days ago•0 views
A library file goes in addon/lua/starfall/libs_[cl,sh,sv]/, declares --@class library and --@libtbl name, calls SF.RegisterLibrary("name"), and returns a functi…
How do SF libraries work - need a simple code example
A library file goes in addon/lua/starfall/libs_[cl,sh,sv]/, declares --@class library and --@libtbl name, calls SF.RegisterLibrary("name"), and returns a function(instance) that fills instance.Libraries.name with functions. instance.env is the global env table, instance.player is the chip owner. Use instance:AddHook("deinitialize", fn) for cleanup when the chip is removed.