Posted 22 May 2013 - 11:51 PM
When I run this startup program and I click on the block the program runs flawlessly but as soon as someone else not dobbylego or steve921 clicks it the program also runs like it was the correct person. Does anyone know how to make it so only specified people can make the program run?
local i = 1
function open()
rs.setBundledOutput("left", colors.orange)
sleep(.4)
rs.setBundledOutput("left", 0)
sleep(.4)
end
function close()
rs.setBundledOutput("left", colors.white)
sleep(.4)
rs.setBundledOutput("left", 0)
sleep(.4)
end
function elevatorUp()
rs.setBundledOutput("left", colors.magenta)
sleep(.4)
rs.setBundledOutput("left", 0)
sleep(.4)
end
peripheral.wrap("right")
while true do
event, playerName = os.pullEvent("player")
print(playerName)
if playerName == ("dobbylego") or ("steve921") then
--This is the part that runs when the correct people click the player detector.
print("Accepted")
open()
open()
open()
sleep(2.0)
close()
close()
close()
else
--This is what runs when the wrong person click the player detector.
print("Denyed")
repeat
elevatorUp()
i = i + 1
until i == 13
end
end