Jump to content




Expected "=" on line 21

computer utility help

2 replies to this topic

#1 BasicContainment

  • New Members
  • 1 posts

Posted 18 August 2016 - 04:59 PM

I keep getting this error when I reboot the computer. It is a startup command if it matters.

print("Input Password To Open Prison Door")
password = read()
if password == "Hanns-G" then
print ("Access Granted")
redstone.setOutput("back",true)
sleep(3)
redstone.setOutput("back",false)
os.shutdown()
elseif password == "Monitor" then
exit()
elseif password == "Punch" then
print("You Monster!")
redstone.setOutput("top",true)
sleep(1)
redstone.setOutput("top",false)
else
print("Access Denied, Shutting Down")
sleep(3)
os.shutdown

end -- This is where the error lies. A value is expected.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,455 posts

Posted 18 August 2016 - 07:47 PM

You forgot the parentheses on the os.shutdown call just above the end.

#3 sonic_overlord25

  • Members
  • 11 posts
  • LocationUS

Posted 20 August 2016 - 06:02 AM

If I may make a suggestion, you can mask the user input on line two by typing

password = read("*")

This will replace the characters that the user is typing in to an asterisk. You can substitute any character between the quotation marks to be used as a mask.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users