Hi all, ive been trying to find a way to make it when a button is clicked it scrolls through allthe decendents of the character and when it finds an accessory with a certain tag name that matches the same name of a model in workspace it sets the model to Transparency = 1.
Dont have much else to say as not really sure how to get round it. No experience with Tags before so help would be appreciated!!
This is how you could iterate over all accessories and check if it has a specific tag, setting the transparency to 1 if it does.
local CS = game:GetService("CollectionService")
buttonInstance.MouseButton1Click:Connect(function()
local targetName = "WorkspaceObjectName"
for _,v in pairs(char.Humanoid:GetAccessories()) do
if CS:HasTag(v, targetName) then
for _, p in pairs(v:GetDescendants()) do
if p:IsA("BasePart") then
p.Transparency = 1
end
end
end
end
end)