So fixing this part of my script windemere said, DID in fact fix my problem, the weird thing is, 3 other scripts of mine had the same mistake (all of them still worked) but also does not crash my editor