What does the self. appended to the beginning of some functions do?
It is used inside object methods to refer to the object itself.
For instance in a scripted weapon :
[lua]
SWEP.Variable = 15
function SWEP:PrimaryAttack()
print(self.Variable) -- Prints 15
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.