💬

Community answer

Collected from the ACE community Discord archive around 2023-09-29. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

How Starfall libraries work

⚡ PerformanceUpdated 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.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.