print("Welcome to the game") input = "" inv = {"coin", "sword", "armor"} while imput ~= "exit" do print("What do you want to do?") input = io.read() if input == "inspect" then print("Youre in a cave. There is an exit.") elseif input == "exit" then print("You left the cave.") elseif input == "inv" then for i,v in pairs(inv) do print(i,v) end else print("You didnt write a valid command...") end end input = "" while input ~= "follow path" do print("What do you want to do?") input = io.read() if input == "inspect" then print("There is a cave behind you. Youre on a cliff. There is a pathway ahead.") elseif input == "follow path" then print("You follow the path") print("A troll appears wielding an axe") print("What do you want to do? (run away, attack)") tinput = io.read if tinput == "attack" then print("You smack with your sword and it falls dead") elseif tinput == "run away" then etc etc etc..
io.read
Quote:while imput ~= "exit" do
input
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)