print ("What is 5+10") while input ~= "15" do input=io.read() if input == "15" then print("Congrates") end if not input then print ("Wrong") return end end
It works, but it does not print "Wrong"
print ("What is 5+10") while input ~= "15" do input=io.read() if input == "15" then print("Congrates") end if not input then print ("Wrong") return end end
It works, but it does not print "Wrong"
3 things:
print ("What is 5+10")
Game:GetService("LogService").MessageOut:connect(function(Msg)
if msg == "15" then
print("Congrates")
elseif msg ~= "15" then
print ("Wrong")
end
end)
return to return().Another solution could be:
print ("What is 5 + 10?")
local i = 5
local o = 10
if i + o == 15
then print ("Congrates!")
else
print ("Wrong!")
end ------These go together BTW :)
if i + 0 ~= 15
then print ("Wrong!")
end
But, that's the longer way to do it.
I'm assuming this is what you were asking.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Oh OK, I got it now. Thanks!