Jump to content

Home

Take object out of inventory and take credits script.


HdVaderII

Recommended Posts

1. What script can you use to take an object out of a creature's inventory, lets say, the PC's inventory?

 

2. I'm using this script,

 

void main ()
{
TakeGoldFromCreature( GetFirstPC(),10);
}

but for some reason, I'm getting weird errors with the line starting "TakeGoldFromCreature"

Help is always welcome.

Link to comment
Share on other sites

1. What script can you use to take an object out of a creature's inventory, lets say, the PC's inventory?

 

If it should just be taken and be gone for good you can use the DestroyObject() function to do it. Like:

 

void main () {
   DestroyObject( GetItemPossessedBy(GetFirstPC(), "[color=Yellow]TagofItem[/color]") );
}

 

Where TagofItem should be changed to the tag of the item to take from the player.

 

but for some reason, I'm getting weird errors with the line starting "TakeGoldFromCreature"

 

You have the parameters to the function in the wrong order. The first should be the amount to take, the second should be who to take it from:

 

void main () {
   TakeGoldFromCreature( 10, GetFirstPC() );
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...