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

Attempt to concatenate string and nil error

Started by codebender, 14 December 2016 - 10:04 PM
codebender #1
Posted 14 December 2016 - 11:04 PM
ok, so Im setting up a security interface for a dungeon on a server, and its suppose to either read a keycard (floppy disc) or input from the user.

Code giving the error:

clearance = "/"..disk.getMountPath("bottom").."/"..keycode
fs.open(clearance,"r")
Bomb Bloke #2
Posted 15 December 2016 - 02:22 AM
And is that all the code, or…?
KingofGamesYami #3
Posted 15 December 2016 - 02:32 AM
disk.getMountPath will return nil if there is not a floppy disk in the disk drive. You should first use disk.hasData to determine if there is a floppy disk in the indicated location.