lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm new and trying to teach my self lua but im stuck. for some reason I can't get the if statement to work properly I play around with it and still nothing.

I call it the lovebot.lua  I'm a big clown so I like to joke around and be creative with me code I hope it doesn't offend  anyone.

second when I get pass this problem I was planing on to making a loop so where the user  is force to  picks the cheapest drink so it's not finish just need help getting pass the if statement part.

what am I doing wrong here.

io.write("Hello how are you beautiful I'm lovebot whats your name:\n ");

g_Name = io.read(); --females name
io.write( g_Name," oh ",g_Name," sounds nice, do you mind if I buy you a drink \n");


reply1 = io.read -- reply1 should only equal yes or no


io.write("yes or no:\n");


reply1 = yes

--no = reply1

if  reply1 == yes  then
io.write("Oh good what would you like to drink ", g_Name, "\n")
print(" white rum $7\n red wine $10\n gray goose $12 \n beer $2")
else
print("come on ")




--elseif "no" == reply1 then
--io.write("come on ", g_Name)

-- I comement out  no = reply1 and the elseif to make it more simple but still somthing is wrong
end