This script seems to be slowing my game down a lot

It is, when I disable the script my game is smooth.