Attach Object to animated Mesh

Hey! Newbie here. Recently tried to apply my first script but failed :frowning: I would appreciate your help if you have time..

Something simple for start:
Want to attach objects on an animated mesh. For example a horn to a Raptor.

  1. Found the following script here (Redirecting...):

local MESH = script.parent

local allObjects = MESH:GetChildren()

for _,obj in ipairs(allObjects) do
if obj:IsA("Folder") then
local socketName = obj.name
local pos = obj:GetWorldPosition()
local rot = obj:GetWorldRotation()

    MESH:AttachCoreObject(obj, socketName)

    obj:SetWorldPosition(pos)
    obj:SetWorldRotation(rot)
end

end

  1. Changed "Folder" to "Horn" and add it on hierarchy like this in photo.! attach|458x110

Questions:

  1. Which parts exactly do I have to modify? Is Folder to Horn correct? Need also to specify somewhere the socket? The issue I have most times is not being sure which parts of codes needed to change๐Ÿ˜…
  2. Is the hierarchy I did correct? Thanks