How would I go about to call a function using only a string, which contains the same letters as the function is named?
The code I require for this to even be useful looks somewhat like this:
function afunction(x) --x is a string "abc" local function abc() print("Function called") end x() end
Thank you for all answers.
Perhaps you could create a dictionary for the functions to call?
function afunction(x) local functions = { --List of functions abc = function() print("Function abc called"); end } local f = functions[x]; --Find the potential function if f then return f(); --If it exists, return the call. else warn("No function found"); --Otherwise, warn the output. end end afunction("abc"); --> Function abc called afunction("nonexistent"); --> No function found