detector is the player detector
What is happening is it opens the door once and displays on the monitor but fails to work again. I think I made a loop somewhere that is causing the program to fail. Can anyone help with this?
I have posted the code below.
*edit* I have yet to impliment the other half of the code for Tarsk69 which is why countt is as of yet unused
detector = peripheral.wrap("front")
m = peripheral.wrap("left")
mx, my = m.getSize()
while true do
event, player = os.pullEvent(player)
local p = player
local countk = 0
local countt = 0
if player == "kauqilla" then
print("Kauqilla has entered")
countk = countk + 1
redstone.setOutput ("right", true )
sleep(1)
rs.setOutput("right",false)
m.setCursorPos( mx/2 -7 , 4)
m.write("Welcome "..p )
m.setCursorPos( mx/2 -7, 5)
m.write("You have been here ")
m.setCursorPos(mx/2 -7 ,6)
m.write(countk)
m.setCursorPos(mx/2 -7, 7)
m.write("time(s)")
sleep(10)
m.clear()
elseif player == "Tarsk69" then
rs.setOutput ("right", true)
sleep(1)
rs.setOutput ("right", false)
elseif player ~= "kauqilla" or player ~= "Tarsk69" then
print("Invalid Player")
rs.setOutput("left",true)
else
print("Error has occured")
end
end