Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Server.is_installed() -> attempt to index local 'self' a nil value #535

Answered by williamboman
sethidden asked this question in Q&A
Discussion options

You must be logged in to vote

Hello! The server variable you're interacting with is an instance of a metatable (this is conceptually very similar to normal classes found in other languages). This metatable have different methods such as is_installed(), which all operate on an individual instance. Without going into too much detail - the problem is that you're not providing which instance the method should target.

On phone atm so I can't verify whether I'm 100% correct now, but the following should explain it in code:

-- You need to provide the server instance as an argument to the metatable (class) functions!
server.is_installed(server)
server2.is_installed(server2)

-- The above looks really awkward though, so there'…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sethidden
Comment options

Answer selected by sethidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants