Talk:OsGetGender

From OpenSimulator

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