This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Neonbabycheese's profile picture

Need help with Nil error

Started by Neonbabycheese, 14 November 2012 - 02:11 PM
Neonbabycheese #1
Posted 14 November 2012 - 03:11 PM
The code is
________________________________________________

local side = "right"
local password = "bacon
local opentime = 5
while true do
term.clear()
write("password: ")
local input == password then
term.clear()
print("Password Correct!")
rs.setoutput(right,true)
sleep(5)
else
print("password incorrect!")
sleep(2)
end
end
________________________________________________

When I put it the password it says Password Correct!
and the line after it says "Password:11: attempt to call nil"

I've tried to fix it over and over but it just wont work so I'm hoping to get an expert opinion on what I'm doing wrong
Edited by
anonimo182 #2
Posted 14 November 2012 - 03:17 PM
1. Use code tags
2. is rs.setOutput("right", true), not the one you used :P/>/>
remiX #3
Posted 14 November 2012 - 06:22 PM
and

local password = "bacon
should be
local password = "bacon"