CollectionService

Hello, I have noticed something with collectionservice; I thought GetTagged returns ALL the objects tagged with a certain tag, in my case it doesn’t seem to do so unless I’m incorrect, but please view below;

  1. --One object tagged with “Nahp”

  2. --Another object tagged with “Nahp”

3 ) image --Using GetTagged function

–IN GAME) image --Ingame with the prints, only raditz printed out and the other object (Nahp object) didn’t

returning in a for loop causes the loop to break, and the returned value to be returned from the function that the for loop is contained in.

2 Likes

Thank you, do you recommend i should put the return outside the for loop

It’s going to create a new NPC for every tagged instance. Do you need to return a NPC?

Yeah I need to return an NPC that is tagged with a certain tag and is under a certain folder

So your script is working correctly then? GetTagged does return all instances with that tag; you’re just not seeing them because of that return.

2 Likes