Hello!
Is there a posibility to do math calculations in a string ? (ex. tArgs[1] = 12-2*2)
[Question] Math
Started by mibac138, Feb 13 2014 12:52 PM
3 replies to this topic
#1
Posted 13 February 2014 - 12:52 PM
#3
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.
#4
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.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












