print("Press 1 to edit control rod settings") a = io.read() if a==1 then print("Enter Control Rod settings") End
0
Big reactor
Started by Blade2277, Feb 26 2019 04:53 AM
1 reply to this topic
#1
Posted 26 February 2019 - 04:53 AM
I am writing a program to control my big reactor but i am stuck on making the UI. I cant get it to enter the computer to enter the if statement, it just ignores it.
#2
Posted 27 February 2019 - 02:45 PM
io.read() always returns strings, but 1 is a number: so your condition will never be true.
http://lua-users.org...uaTypesTutorial
You could do:
Or, instead:
http://lua-users.org...uaTypesTutorial
You could do:
if a=="1" then
Or, instead:
a = tonumber(io.read())
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users