Author Sticky: Post Working Scripts Here
Ian Posted: Sunday, 30 June 10:00PM
1. sc_sit_general
2. It lets a Pc or NPC sit on a chair, bench or stool or anything else on what you can sit.
3. A little problem arises as sometimes, if you walk towards a usable, in terms of sitting, object and you left click on it he might use an object right besides of the one you choose. Haven't tried GetNearestObject with nNth = 0 though. Maybe that works and helps.

4.
NWScript:
void main()

{

    object oUser = GetLastUsedBy();

    object oSittable = GetNearestObject(OBJECT_TYPE_PLACEABLE, oUser, 1);

    if (oSittable != OBJECT_INVALID)

    {

        AssignCommand(oUser, ActionSit(oSittable));

    }

}



Have fun and keep up the good work.

Ian

Edit: DO NOT, and I repeat, DO NOT use 0 as nNth with GetNearestObject(). I just tried it and it killed my running game, repeatidly. Seems as if Nwn cannot cope with what I want.