#Attempt to index nil in a loop though it has a check
11 messages · Page 1 of 1 (latest)
Ok basically i have checked if newMob is nil before line 125 but the error still appears
check the type of newMob
Its a model
can you use proper screenshots next time
but I think the issue is “newMob” doesn’t have a primary part set
since what I’m assuming you’re doing is newMob.PrimaryPart.Position from the first screenshot
and the error in the second screenshot would be because primary part is nil
hence trying to index with nil
It does, this just happen when newMob died
Nvm i just replaced return with newMob:Destroy() and somehow it works đź’€