Jump to content

Home

(TSL) Empty inventory script


Malxados

Recommended Posts

Well if your talking total item destruction - I warn you though, not many players are going to like that :p - this script will do the trick:

 

void main() {
   object oPerson = GetFirstPC();    // Presumably you want to empty the players inventory.
   object oItem = GetFirstItemInInventory(oPerson);
   while(oItem != OBJECT_INVALID) {
       DestroyObject(oItem);

       oItem = GetNextItemInInventory(oPerson);
   }
}

Link to comment
Share on other sites

What if you want to put all items he has into a locker, so you can get them back? (Like on the leviathan)

 

I think glovemaster's script destroys all item you have and can't get it back. I'm sure there's a script in K1 for that. The problem is that the script is compiled:p

Link to comment
Share on other sites

Just a few adjustments to that script will do ^

 

void main() {
   object oPerson = GetFirstPC();
   object oStorage = GetObjectByTag([color="cyan"]"tag_of_locker"[/color]);
   object oItem = GetFirstItemInInventory(oPerson);
   while(oItem != OBJECT_INVALID) {
       AssignCommand(oStorage, ActionTakeItem(oItem, oPerson));
       oItem = GetNextItemInInventory(oPerson);
   }
}

 

That should work :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...