Posted 21 June 2014 - 03:37 PM
When I put 2 whitelisted people in the script, it won't work? Can somebody help me?
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right")
names = "test"
whitelist = {"samduuren"}
while true do
term.clear()
term.setCursorPos(1,1)
local targets = prox.getTargets()
for name,basicDetails in pairs(targets) do
for key,value in pairs(basicDetails) do
if basicDetails.Name == "Player" then
detected = "true"
print(name)
for i = 1,#whitelist do
if name == whitelist[i] then
rs.setOutput("left", false)
else
if name ~= whitelist[i] then
rs.setOutput("left", true)
sleep(0.5)
rs.setOutput("left", false)
end
end
end
end
end
end
end