How to return a value from a void function and use it inside the void loop?

Go look at the function i wrote again. It doesn't say "void" anywhere in it.

PS. It did for a few seconds. I had to edit and fix it.