What is "self" and how do I use it?

I’ve been trying to follow along a tutorial which teaches how to use trove, and I see them constantly use “self”. How do I use it, and why does it throw “unknown global, self” at me when I try to use it?

You will find the youtube video as well as my own attempts below:

local function setup(character)
	
	self._Trove = Trove.new

Here’s a good post that goes over OOP:

1 Like

Thank you! Due to the complexity of OOP, I’ll learn it some other time. However, this did explain where the “self” came from.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.