128 posts
Location
Poland
Posted 13 February 2014 - 12:52 PM
Hello!
Is there a posibility to do math calculations in a string ? (ex. tArgs[1] = 12-2*2)
758 posts
Location
Budapest, Hungary
Posted 13 February 2014 - 01:01 PM
It depends on what you call a string. In that example of yours
tArgs[1] = 12-2*2
there are no strings at all. Give us a less foggy explanation of what you are trying to do.
128 posts
Location
Poland
Posted 13 February 2014 - 01:25 PM
Do something like a calculator - u give input (ex. "12-2*2") and it counts how much it is.
8543 posts
Posted 13 February 2014 - 01:32 PM
Yep, it's possible. The simplest way is to use loadstring. That will allow any executable Lua code to be run though, so it's probably a bad idea to use it if security matters in the least. There was another thread on this very recently that had some good information. Check that out as well.