I know I don't have to declare the variable in this first line, but I would still like to know why it doesn't work. I thought it would be a float variable and I wanted to be proper and all and declare it right off the bat. But I get an error that says "invalid redeclaration of variable." How should the first line be written then when I declare the variable.
Since it's saying your "redeclaring", it usually means you are working in the Script Editor and have already told Maya that this particular variable is a different type (i.e. other than float), and now you changed it to a float, and it doesn't like it because it thinks it's still whatever you first said.