How to get specific part using :GetFullName()

so if you have a folder that contains 2 decals with same name, and you want to search decal number one and not number two with :GetFullName().


My problem is when you use GetFullName() it will print/retun the name so using :FindFirstChild() or :WaitForChild() isn’t effective, because it will randomly choose the decak because it has the same name

1 Like

Instance | Documentation - Roblox Creator Hub GetFullName is not going to help you differentiate between 2 decals with the same name. I would either save the actual instance, or save the ID. You can then loop over the decals and find the one with the same ID if you must get the instance from the ID.

1 Like

so do you mean saving the instance in a table with for loop ?

I have no context for this so I don’t know what you are asking. Are you trying to save an ID?

so, there was a folder in workspace, and that folder have 2 decals, i want to get specific decals with the same name in that folder, and sorry Decal is only an example

It’s hard to understand what you actually want to do. If you do :GetFullName(), that implies you already know what it is that you wanted, because you ran that method call on the instance itself.

appreciate all your help, i will show you what i mean

Screenshot 2023-06-04 070247

in the folder you can see, it got 2 decals with the same name,

so using :GetFullName() and this script is not effective because it will returning random decal

function module.SearchInstance(Path:string)
	local stringsplit = string.split(Path,'.')
	local direc = nil
	for _, keep in ipairs(stringsplit) do
		if not direc then
			direc = game:FindFirstChild(keep)
		else
			direc = direc:FindFirstChild(keep)
		end
	end
	return direc
end

i hope this can make an image to how my problem was

Simply don’t have objects with the same name in the same folder?

If these are created on the fly name them accordingly:

local decal = Instance.new("Decal",cache);
decal.Name = "Decal" .. #cache:GetChildren()+1;
1 Like

its constantly changes (Deleted, Parent Change, etc), so tracking every instance is hard

hmmm, i think this is the most easy way to solve my problem xd, thanks btw

1 Like

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