llGetAttached
LSLinteger llGetAttached()
Returns the object's attachment point, or 0 if not attached.
Takes no parameters.
Energy
10
The Linden Scripting Library — what every SL-compatible grid provides.