last line of code

for some reason the last line of code on this script will not work if i
write it out as and if else it works