so, when i make a module script, this thing called self randomly appearing out of no where. and somehow i cant get rid of it
When you define a function using :
, the first argument must be a reference to use as self
. Luau will automatically do this for you when calling a method with :
.
Module:Function(x, y)
is equivalent to Module.Function(Module, x, y)
. While technically anything can be passed as this reference, it is supposed to be a reference to the module itself, useful for making classes, and is essentially lua’s version of this
when used correctly.
If you do not want this functionality, then do not define your function using :
, instead use .
.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.