Weird Behaviour with Primary Parts

I am attempting to clone a model from ServerStorage into Workspace. There is weird stuff happening like when I print the PrimaryPart’s name it prints the name but then immediately after gives an error: attempt to index nil with 'Name', implying the model’s PrimaryPart is nil, but if so, how did it print its name?

The code is nothing special:

room = room:Clone()
print(room.PrimaryPart.Name) --this line prints its name, then errors immediately after
--the error and the print statement both happen on line 60

The code prior just chooses a random room from server storage. Again nothing special.

Model:
Screenshot 2024-12-30 085134

This is just weird, this might be an engine bug because I’m 99% sure that a statement should not work and then not work right after.

I might be wrong, but is the PrimaryPart’s archivable property set to true?

1 Like

Yes it is. Every part of the model has Archivable set to true.

1 Like

Bruh I’m dumb asl. I was calling it from a for loop so it was erroring on a different iteration. Mb.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.