Talk:OsGetGender

From OpenSimulator

Revision as of 15:47, 17 May 2023 by Gwyneth Llewelyn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Equivalent in pure LSL

In pure LSL this can be accomplished with:

string getGender(key id)
{
    list out = llGetObjectDetails(avatar, [OBJECT_BODY_SHAPE_TYPE]);
    if (out == []) return "unknown";
 
    float shape = llList2Float(out, 0);
    if (shape == -1.0)
    {
        // avatar out of range, invalid UUID, or id is not an avatar:
        return "unknown";
    }
    if (shape < 0.5)
    {
        return "female";
    }
    return "male";
}

See also the example on the LSL Wiki page.

Gwyneth Llewelyn (talk) 15:43, 17 May 2023 (PDT)

Personal tools
General
About This Wiki