You may want to do a few basic lua tutorials before attempting to write a script such as this.
1. os.pullEvent = os.pullEventRaw
2. local accept = true
3. local denied = false
4. local opentime = 5
5. local password = "changeme"
6. while true do
7. term.clear()
8. term.setCursorPos(1,1)
9. write ("Enter Override:")
10. local input = read("*")
11. function rsevent()
12. if rs.getInput ("top") then
13. os.pullEvent( "redstone" )
14. rs.setOutput ("left",accept)
15. os.pullEvent = pullEvent
16. sleep(opentime)
17. rs.setOutput ("left",denied)
18. end
19. elseif input == password then
20. rs.setOutput ("left",accept)
21. term.clear()
22. term.setCursorPos(1,1)
23. print ("Password Correct")
24. sleep(opentime)
25. rs.setOutput ("left",denied)
26. else
27. rsevent()
28. end
The first thing that stands out to me is where you define the rsevent() function on line 11. This function is defined in the middle of a while loop which is something you should not/ can not do. This function should be defined above the while true do loop.
The next thing is lines 12, 13, and 15. First you check if the computer is receiving input from the top (line 11), then you tell the computer to wait until the redstone state changes on any side of the computer(12), then on line 15 you set os.pullEvent to a nil value. Lines 13 and 15 should be removed.
On line 18 you end the if statement, which makes it to where the elseif statement on line 19 will error. This end statement should be removed.
The code i posted is not fixed. I posted it simply so I would have line numbers to easily reference.