The basic script did not work, so I asked ChatGPT for help - did not work either.
This is what GPT provided me with:
local groupId = 14807185
local minRankId = 5
local Folder = game.ServerStorage:WaitForChild("Test Fedora")
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(groupId) >= minRankId then
plr.CharacterAdded:Connect(function(char)
plr.CharacterAppearanceLoaded:Wait()
for _, accessory in pairs(Folder:GetChildren()) do
if accessory:IsA("Accessory") then
if accessory:FindFirstChild("Handle") then
for _, att in pairs(accessory.Handle:GetChildren()) do
if att:IsA("Attachment") then
warn("Attachment Name: " .. att.Name)
end
end
else
warn("No Handle")
end
plr.Character:WaitForChild("Humanoid"):AddAccessory(accessory)
else
warn("Not an attachment")
end
end
end)
end
end)
I still do not know what the case here is.