How to check if all the names in a model are different?s

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    printing all the same name in a model (character)
  2. What is the issue? Include screenshots / videos if possible!
    No issues
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No solutions yet
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

--Local Script

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local Model = Player.Character or Player.CharacterAdded:Wait()
local Names = {}
local Objects = Model:GetDescendants() -- or GetChildren, whatever you prefer and need

for _,object in pairs(Objects) do
    if not table.find(Names,object.Name) then
       print("New name")
       table.insert(Names,object.Name)
    else
       print("this name already exists in our table, so we know we dont need the same one")
    end
end

This is a basic example, hopefully I understood you correctly.

No, I think you didn’t understand me correctly, the character is actually a character I am trying to animate but brings up an error. Not the player’s character

1 Like

You just have to replace Model by your model

Oh, my bad.

What error does it give to you? do you have any code to sow?

I am using animation editor and it brings up this error :
Screenshot_274

Can I see a screenshot of the explorer for the model

It has a lot of parts in it so I can’t sorry

That means that in the model you are trying to rig, there is a part inside of the rig with the name equal to another different part in the rig. You will have to rename any duplicates, this does includes parts inside of folders or models.