functions in libraries should be registered to the library table.i am trying to make a library with the following structure:
library.lualuna.luaCode:
function onStart() --Do stuffend
for some reason, the onStart function in the library isn't called. i've tested playing a sound effect in the global scope of library.lua and luna.lua, as well as within a new onStart function within luna.lua, and these all trigger. but if it's specifically within the onStart specified within a require, it doesn't work. why is this happening?Code:
require("library")
Code:
local myLib = {}function myLib.onStart()endregisterEvent(myLib, "onStart")return myLib
Statistics: Posted by Emral — Thu May 01, 2025 3:38 am