Aller au contenu

Photo

Must have item equipped


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

#1
archer4217

archer4217
  • Members
  • 105 messages
Hi all,

Got another question for ya.  I have this script where you can set up a campfire but only if you're holding a torch. The generator lets you specify which hand to have the torch in...how can I modify it so it doesn't matter which hand holds the torch?

location lTarget;
object oSpawn;
object oTarget;
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 2.3

For download info, please visit:
http://nwvault.ign.c...=4683&id=625    */

//Put this on action taken in the conversation editor
void main()
{

object oPC = GetPCSpeaker();

if (GetTag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC)) == "NW_IT_TORCH001")
   {
   oTarget = oPC;

   lTarget = GetLocation(oTarget);

   oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "lje_campfire", lTarget);

   }
else
   {
   SendMessageToPC(oPC, "(You must be holding a torch to start a fire)");

   }

}

thank you for any help. :)

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
if ((GetTag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC)) == "NW_IT_TORCH001") || (GetTag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC)) == "NW_IT_TORCH001"))

The symbol || means "or" so the above means "if they have the torch in their right hand or their left hand."

Modifié par _Knightmare_, 13 novembre 2010 - 02:11 .


#3
archer4217

archer4217
  • Members
  • 105 messages
Thank you, sweetie *hugs*