Posted 23 March 2013 - 02:02 PM
Title: Securtiy door, need help!
Hello! So I have been working on a program that uses a player detector to open a door if the player is on a whitelist, and if they aren't deploy a turtle to attack them. My problem is that it opens for everyone. I don't know why, and have spent an hour messing with it. Here is my code:
Any help is appreciated.
Hello! So I have been working on a program that uses a player detector to open a door if the player is on a whitelist, and if they aren't deploy a turtle to attack them. My problem is that it opens for everyone. I don't know why, and have spent an hour messing with it. Here is my code:
Spoiler
print("Keltecfanboys Security System V2.0")
print("Right click the player detector to the left to begin!")
rednet.open("back")
local ul = fs.open("ulist")
local pds = "left"
local oside = "bottom"
local otime = "8"
local p = peripheral.wrap(pds)
local rign = os.pullEvent("player")
local l1 = ul.readLine(1)
local l2 = ul.readLine(2)
local l3 = ul.readLine(3)
if rign == l1 or l2 or l3 then
rs.setOutput(oside, true)
sleep(tonumber(otime))
rs.setOutput(oside, false)
else
print("Unauthorized user!")
rednet.send(2, attack)
end
os.reboot()
Any help is appreciated.