Hi momaydopod,
when posting errors, please try to copy&paste the error-text, not a Screenshot. Most people don't have microscopes at their desk ;) (It also makes working with the error-text easier, like looking something up ...)
The Script in your screenshot and the one you posted above appear to not match.
When having trouble with a large script that contains multiple functions, you may want to minimize clutter, by leaving out the cosmetic functions that work without error. Posting a big Wall-of-Script reduces the chance someone else will try looking it through
and actually find your error.
Finally, when asking a question, you may want to include a bit more text than just one short line, saying "I try to run this, have error". Adding a proper greeting, describing what you are trying to achieve, what troubleshooting you did and professing eternal
gratitude if someone will help (yeah, that last one is a bit of an exaggeration) certainly
will increase your chance someone will try to help you.
Now you got advice on how to post in this forum instead on your script-problem, because frankly, that appears a more critical problem of yours ;)
Cheers and good luck with the script,
Fred