Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Tiny Desk Engineer

"Attempt to index global "iris" (a nil value)" error when trying to call function in custom library

Question

I'm working on a server that handles connections between Stargates in the mod AUNIS: Resurrection (Now known as Just Stargate Mod) and I created a simple library to make controlling the iris/shield on the connected gate less tedious, but when I attempt to call one of the functions in the library, I get an error which seems to indicate that the "iris" variable referencing the iris library is either nil or nonexistent. Why is this?

I have attached the server and library lua files below for debugging.

 

 

server.lua iris.lua

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
  • Solution

Oh. The library just wasn't reloaded since it was last edited. Oh well, if anyone else is experiencing a problem like this, just set the entry for the library that needs to be reloaded in package.loaded to nil. require should completely reload the library the next time it's used.

Link to post
Share on other sites
  • 0
3 hours ago, Tiny Desk Engineer said:

Oh. The library just wasn't reloaded since it was last edited. Oh well, if anyone else is experiencing a problem like this, just set the entry for the library that needs to be reloaded in package.loaded to nil. require should completely reload the library the next time it's used.

No, wait, that doesn't seem to work. Just use the classic "turn it off and then back on again" solution.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.