This is the code:

module.Codes = {

    ["FreeMoney"] = function()
    
    end;

}

How can I call the function and also get the name(which in this code is "FreeMoney")? Something like this:

module.Codes.FreeMoney.Name

module.Codes.FreeMoney()

`

I simply want two things:

  1. The string:"FreeMoney"
  2. The function

Please tell me if it is possible and if it is then how can I do it.

6 comments

0

only thing i know ur doing wrong here since im a bit tired is ur coding with java or javascript(idk the differens), this is not either of them this is lua

1

the most logical thing is the __call metamethod for the function, and make "FreeMoney" a dictionary with a "Name" key

0

I have posted a lua code.

0

theking48989987 I will try your method.

1

it is definitely possible, I created a working example

0

theking48989987 it worked! Thanks so much!!!!!!!!