Attachments are objects. Like other objects, they can contain scripts, sounds, animations, and be flexi or lights. Most building techniques also apply to building attachments. Cartoon (fullbright with outlining,) unusual shapes from prim torture, tiny prims, flexible (flexi) prims, sculpts, mesh, and much more can be used.
For animations, textures, and sounds, go to the menu on the top left of the screen. Pick "Build" then "Upload" then from the list pick the kind of upload you want (Image, Sound, Animation, Bulk.) You'll be charged 10L per file. If you're uploading mesh that's variable cost. There's a preview option on most things, make sure you look it over if it is offered.
Scripts are free. Go into Edit mode, select the prim, then pick the contents tab and create a new script. Or create one in your inventory and drag it into the contents of the prim. Then start typing. Scripts are text, so you can copy and paste from different sources.
The Gimp - free 2D image tool
QAvimator - free animation tool
Objects that are almost directly on an attachment point are usually fairly easy to adjust for avatar movements. Pay careful attention to attachments that span joints or when trying to cover the entire torso.
You may want to attach more than one thing to the same point. Most often this is for animated objects, such as a head with a moving jaw, twitching ears, wagging tails, etc. The following is a list of attachment points that move together as a unit.
skull | mouth | chin | nose | left ear | right ear
pelvis | stomach
left pec | right pec
chest | spine
left eye | right eye (These do not always move together.)
left hip | left leg
right hip | right leg
This is now less important since most viewers allow you to wear up to five objects on each attachment point.
The effects when attachments are further away from their attachment points are very important if you're trying to make multi-legged avatars (centaurs, bugs) or giant avatars. More than one person has had an avatar that looked great on a pose stand but looked horrible when moving.Spend some time learning how attachments on different body parts behave when an avatar is animated. Make a small prim, attach it about a meter from the body part, run thru a couple of those free animations and watch how it moves in relation to the body part.
Attachments involving hands are a special frustration. The base avatar's fingers don't animate. The hand changes shape when the base avatar makes a fist or points. So rings, prim fingernails, and other attachments on the hands sometimes appear to be in the wrong location depending on how the hand is currently shaped. This is also worth remembering when creating an attachment to cover the hands.
Mesh attachments are a special case. If they were uploaded as rigged, they'll interact with your default avatar shape based on the rigging information and ignore what attachment point you use.
Sensors cannot detect attachments, although llGetAgentInfo() can be used to determine if an avatar is currently wearing any attachments. Avatars cannot sit on attachments. HUDs are a special kind of attachment.
llPlaySound() creates sound that moves with the avatar. llTriggerSound() creates sound that does not.
The moving_start and moving_end events require special handling. To make the moving events fire correctly, you have to add the script to the attachment, take off the attachment, then wear the attachment again. If you're changing the script while it is in the attachment, you recompile it, then remove the attachment, then wear the attachment.
llCreateLink(), llBreakLink(), and llBreakAllLinks() fail silently when called on a worn attachment.
llGetLocalPos() can be used to get an attachment's position relative to its attachment point. llGetPos() returns the avatar's location.