This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kansas54's profile picture

Attempt to index ? a nil value?

Started by Kansas54, 13 January 2017 - 01:08 PM
Kansas54 #1
Posted 13 January 2017 - 02:08 PM
Here's my code:
http://pastebin.com/XFjh8jUa
The error happens at line 2.
I am clueless. anyone?
Lyqyd #2
Posted 13 January 2017 - 06:57 PM
Moved to Ask a Pro.
Lupus590 #3
Posted 13 January 2017 - 07:14 PM
fs.exists not sf.exists
Edited on 13 January 2017 - 06:14 PM
AlexDevs #4
Posted 13 January 2017 - 09:44 PM

while true do
  local _, side = os.pullEvent("disk")
  if fs.exists(disk.getMountPath(side).."/KANSASBASE") then
	rs.setOutput("back",true)
	sleep(6)
	rs.setOoutput("back",false)
	disk.eject(side)
  end
end

Fixed + optimized
Edited on 13 January 2017 - 08:47 PM