I assume that game.Workspace.Bots is a folder since the script parent is inside Rig, but im not sure if thats the case of the error, nor that a primary part is an issue because it only stops trying to find Position. Maybe check if HumanoidRootPart does exist first before continuing
Line 17 I have no clue, id check the rig and see if i accidentally added a capital or misspelt the name.
if it aint those then its most prob a performance issue, scripts tried to find it while its loading up so it crashed so yea its best to manage it with one script