Author Topic: Sit on object script  (Read 304 times)

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Sit on object script
« on: January 14, 2011, 04:16:40 pm »


               Ok, so I'm trying to make a bench to sit on.  Used a generator and this is what it spit out, and its not working.  Assistance please?

void main()
{

object oPC = GetClickingObject();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, ActionSit(GetObjectByTag("bench001")));

}
               
               

               
            

Legacy_Starbridge

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Sit on object script
« Reply #1 on: January 14, 2011, 04:42:10 pm »


               This ended up being the one that worked.  Figured it out after I tinkered a little more.


//Put this script OnUsed
void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, ActionSit(GetObjectByTag("bench001")));

}
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Sit on object script
« Reply #2 on: January 14, 2011, 05:11:07 pm »


               There's several premade scripts you can use already. "x0_o2_use_chair" is one of several. Just drop it into the OnUsed event of a chair, bench, etc... . I prefer to use it in an invisible placeable that I lay over chairs, couches, benches.