Aller au contenu

Photo

Sit on object script


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Starbridge

Starbridge
  • Members
  • 29 messages
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")));

}

#2
Starbridge

Starbridge
  • Members
  • 29 messages
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")));

}

#3
kalbaern

kalbaern
  • Members
  • 824 messages
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.