I have a function e.g.
function run()
print("hi")
end
I have a string called message which contains the word "run":
activity = message
print(activity) --returns run
However I am unable to use the string activity to run the function run()
. I have tried:
func = loadstring(activity.."()")
func() -- I get an error on line 1 saying: attempt to call nil