It looks like you're new here. If you want to get involved, click one of these buttons!
print("Enter Your Name")
name = io.read()
print(name)
travellers = {}
for i = 1, 3 do
print("Enter the name of traveller".. i)
travellers[i] = io.read()
end
print("You and your fellow travelers come a cross a cave and go inside")
print("Once inside you see a fork in the path")
print("Do you choose path 1 or 2")
choice = io.read()
if choice == 1 then
print("you enter an open room and see a chest against the wall, you open it and its full of gold")
print("you and your fellow travelers are now rich")
elseif choice ==2 then
print("You and your buddies walk in to a dead end")
print("without warning bandits ambush you and kill everyone")
print("game over")
else
print("invalid choice")
end
Comments
@Willkassens Welcome to the forum! You are close, but Codea does not use io.read(). If you look around the forums you will see multiple post on using the keyboard for your "choices"
Also, use three ~'s to format before and after your code
Example:
(Take out the spaces)
~ ~ ~
Code Here
~ ~ ~
I fixed your formatting as suggested by CodeaNoob
@Willkassens Just to give you an idea of what it takes to do what you're trying, here's one way to do it. Press "return" after each entry.
Better, in Codea, is to draw a couple of on screen buttons and get the user to touch one of them. Entering 1 or 2 is for old DOS machines!
Thanks everyone! You've helped tons!