Get a function from a module using a string

As the title exactly says how would I run a function from a module script using a normal script. Let me give an example.
instead of doing if A == B then
module.A()

instead i can do

module[A] and it just runs

1 Like

You can use module["A"] if that works for you. It works with anything.
game["Workspace"]["BasePlate"]["BrickColor"] = BrickColor["new"]("New Yeller")

That doesn’t work I was just giving an example. I want to run a specific function within the module however I want it to run whatever the string is so essentially finding the function and then running it in the module. I have already tried your proposed solution.

Oh, are you saying that the variable is A? Then yes, that definitely works too.

local A = "ExampleFunction"
module[A]()

Thanks for saving a lot of time.