View Single Post
Unread 10-07-11, 10:41 AM   #1
Dziriki
Zombie
Join Date: Oct 2011
Posts: 2
Call a function in another codefile

Hello, I am relatively new to programming in LUA. I cannot figure out how to call a function located in a secondary .lua file inside the addon folder.

I have 3 files in the folder.
addon.lua
objectfactory.lua
RiftAddon.toc

I add both lua files to RiftAddon "RunAtStartup" section.
But every time I try to call a function in objectfactory I get this error:

Error: attempt to index global "function" (a nil value) In addon/addon.lua

Any advice would be greatly appreciated.

Last edited by Dziriki : 10-07-11 at 10:41 AM. Reason: Typos.
Dziriki is offline   Reply With Quote