Posted 19 December 2012 - 02:50 PM
So I was getting ready to make a text based game (sort of like the one included) where a user would type an input, like hit or mine something, and the program would react accordingly. So what I was wondering if there was some way to call a string (I guess you would say). So:
function punch()
steve.punchTree()
TreePunch = true
end
action = read()
[value of action]()
I know that you could do a lot of if statements, but I was curious if there is a simple way to do this in this manner.