Ok I'm stupid sorry, I figured out what the problem is and I found out where the code needed to be placed. So far it seems to be working.