πŸ’¬

Community answer

Collected from the ACE community Discord archive around 2024-03-01. It may be informal or outdated β€” anyone can edit this page to improve it. Original discussion

Using self inside a class method called from a hook

⚑ PerformanceUpdated 2 days agoβ€’0 views
The tick hook was calling self.door() as a plain function so self was nil - call it as a method self:door() (colon). To register the hook you can use string.for…

Why does 'attempt to index local self (a nil value)' happen in a class function

The tick hook was calling self.door() as a plain function so self was nil - call it as a method self:door() (colon). To register the hook you can use string.format for the hook name with self's fields.

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.