The problem is that toggleFunction takes a value from a list and appends it to "Toggle". So then I get "ToggleLocation" on one iteration, "ToggleFPS" on another, and so on. That string was then being used for setting the button handlers to call functions with those names.
It works fine, if the functions are in or descended from the global namespace, but it hates it when they are local functions. I've seen plenty of examples online of how to accomplish it using loadstring, but I've gone through just about every method of using it and cannot get it to work.
For now, I'll just put the functions back into the global namespace. I'd rather have a working product right now until I can get it right.
|