How can I call a function from a string in LUA?
EG I had a string like this: "DoMath("1+1")" and I wanted to use that string to call DoMath("1+1")
Calling a function from a string
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Calling a function from a string
Code: Select all
loadstring (string [, chunkname])
Similar to load, but gets the chunk from the given string.
To load and run a given string, use the idiom
assert(loadstring(s))()
When absent, chunkname defaults to the given string.
Who is online
Users browsing this forum: No registered users and 10 guests