Posted 04 April 2014 - 08:53 AM
hello everyone,
I have a question about cc, i'm not good at it but i'm trying to learn it.
I'm making a program to automatically open the door of my house ( castle ) if a player approaches.
I use a sensor at the left side of the advanced computer and the redstone output is at the back of the computer
this is the code I wrote and the error it gave.
Can someone help me?
os.loadAPI("sensor")
prox = sensor("left")
while true do
t = prox.getTargets(name)
if t == "aisha_girl_15" then
rs.setOutput("back",true)
wait(15)
rs.setOutput("back",false)
else
wait(5)
end
end
and the error it gave:
file not found:
doorway:2: attempt to index ? ( a nill value)
I have a question about cc, i'm not good at it but i'm trying to learn it.
I'm making a program to automatically open the door of my house ( castle ) if a player approaches.
I use a sensor at the left side of the advanced computer and the redstone output is at the back of the computer
this is the code I wrote and the error it gave.
Can someone help me?
os.loadAPI("sensor")
prox = sensor("left")
while true do
t = prox.getTargets(name)
if t == "aisha_girl_15" then
rs.setOutput("back",true)
wait(15)
rs.setOutput("back",false)
else
wait(5)
end
end
and the error it gave:
file not found:
doorway:2: attempt to index ? ( a nill value)