Why I can't use my function? "Accessed none trying to read..."

I’m getting some error. I’m going to create a new post. Link: Gettting "cast failed" and other errors