Author Sticky: Post Working Scripts Here
Logxen Posted: Sunday, 23 June 10:12PM
Here is how to make a chair your PCs can sit on. :)

1. Make a Chair placeable
2. Set the Chair to be useable
3. Put this script in the chair's onused hook:
NWScript:
void main()

{

    object oPlayer = GetLastUsedBy ();

    object oChair;

    if (GetIsPC (oPlayer))

    {

        oChair = GetNearestObjectByTag ("Chair", oPlayer, 0);

        if (GetIsObjectValid(oChair) && !GetIsObjectValid (GetSittingCreature (oChair)))

        {

            AssignCommand (oPlayer, ActionSit (oChair));

        }

    }

}


That should do it. Just make sure if you change the chair's tag you also change it's tag in the GetNearestObjectByTag() command. When the player clicks on the chair they should then sit in it.

Edited to make sure no one was already in the chair.