When I mean built-in function color, I mean this (im using the default settings/colors)
You get the idea.
Making self color like this (like :remove()) is pretty minor but I just feel it’d add a bit to the interface when scripting. I’m not a big OOP fan when it comes to Lua but in JS, the equivalent of self is this. But this in coding interfaces like Notepad++ in JavaScript is auto colored like that. I’d be skeptical about why ROBLOX studio hasn’t added this into its database yet. ¯\_(ツ)_/¯
@Mr1Vgy it is if you invoke a function in a table as a method, ie
local tbl = {}
tbl.internalSafeValue = 0
function tbl:incrementSafeValue()
– santize inputs here, ensure validity
self.internalSafeValue = self.internalSafeValue + 1
end
where within the function tbl:incrementSafeValue() self refers automatically to the table the function “incrementSafeValue” is found within. It’s a bit more technical but that’s the simple version. This is useful for creating psuedo class inheritance where we have classes that spawn helper classes, and we want one function to handle everything rather than creating multiple functions for every helper.
Hm. Assuming no one has any objections internally (and I doubt they would), I’m gonna make this happen. Even we use “self” extensively in our internal Lua code.