#Attempt to index nil in a loop though it has a check

11 messages · Page 1 of 1 (latest)

unborn vessel
#

I CAN'T PUT MY IMAGE HERE (nvm)

#

Ok basically i have checked if newMob is nil before line 125 but the error still appears

coarse island
#

check the type of newMob

unborn vessel
faint field
#

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

unborn vessel
unborn vessel
#

Nvm i just replaced return with newMob:Destroy() and somehow it works đź’€