I was fiddling around with module scripts and remembered you could use : and . when using functions with module scripts. I know how : defines the module script as self and . does not, but when would this be useful?
If I’m misunderstanding anything, please point it out! It’s been a hot minute since I’ve scripted :))
Well I did figure it would be used for OOP, I probably should have said that. I kind of meant how would it be used more specifically? Like why would it be useful to reference the script that self represents?
: is just there so that self is implicitly defined. Otherwise, you’d have to do Class.Method(object, ...) every time. Whereas with the colon, you can simply do object:Method(...).
I mean, imagine having to do game.GetService(game, "service") dozens of times.