Topic: Scripting
Hey, if you need to concatenate two strings and compare them how do you do that?
item = "gun"
inventory = {}
answer = io.read()
if answer == "take" + item then
inventory[1] = item
end
You are not logged in. Please login or register.
Hey, if you need to concatenate two strings and compare them how do you do that?
item = "gun"
inventory = {}
answer = io.read()
if answer == "take" + item then
inventory[1] = item
end
Hmm in lua i think its like this:
if answer == "take"..item then
(then it does not matter if "item" is a number too...for example item=11 so take11 is result...
Last edited by pleedian (2013-04-18 15:44:24)
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.