Can you call a method like that way?

I’m doing a function inside a Module Script that gets the player’s friends:

function Functions:GetFriends(localplr):number
	local tabela = {}
	local plrs = plrs:GetPlayers()

	for _, v in pairs(plrs) do
		local UserId = v.UserId
		local IsFriendWith = localplr:IsFriendsWith(UserId) and Tabelas.Armazem.tableinsert(tabela, v)

	return #tabela

Is it possible to call this function like that, for instance:


If yes, how?

1 Like

I suppose you may need to use self? But I have doubts about the usage of self and even self is.

What are your intentions?
What is this line of code supossed to do?

1 Like

I’m trying to call the module function to something similar to that, like:


It has the instance:Function().

when doing instance:Function() you are just doing instance.Function(instance), which is used in OOP to be able to access self keyword, if your function is not on an OOP class or doesn’t require this, there is no reason you should seek for it to be called that way.

That’s because I’d be creating a new function “inside” the instance, and it would be convenient for me