GSC reference › Built-in
DropItem()
Built-in (engine)
Server
Player Called on: player
Drop an item with the given item name
Signature
<player> DropItem(<item name>, [dropTag])
Called on an entity: player DropItem(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| item name | Required | the name of the item to drop |
| dropTag | Optional | If specified drop and snap the weapon to this tag |
Returns
entity
Example (from Treyarch's docs)
self DropItem( current )
Real uses in BO3's scripts
Called 4 times in the decompiled scripts. A few, zombies first:
- scripts/zm/gametypes/_weapons.gsc, line 396
item = self dropitem(weapon); - scripts/shared/weapons/_weapons.gsc, line 441
item = self dropitem(weapon); - scripts/cp/_mobile_armory.gsc, line 174
item = self dropitem(weapon, "tag_origin"); - scripts/cp/bonuszm/_bonuszm_weapons.gsc, line 422
item = self dropitem(weapon, "tag_origin");
Related built-ins
- DropScavengerItem()Drop an item with the given item name.
- GetItemIndexFromRef()Returns the item index for the specified item reference
- GetBaseWeaponItemIndex()Returns the base weapon item index from the statstable
- GetLoadoutItem()Get the index of the item in the custom class
- GetLoadoutItemRef()Get the reference of the item in the custom class
- ItemWeaponSetAmmo()Set the weapon ammo to the given clip ammo and reserve ammo.
- GetRefFromItemIndex()Returns the ref for a specified item index
- GetItemGroupForWeaponName()Returns the ref for a specific weapon name
- GetItemAttachment()Gets the attachment for a particular item
- GetEquippedLoadoutItemForHero()Returns 1 if the hero's ability is equipped, 0 if the weapon is equipped.
- GetItemArray()Returns an array of all of the items in a level.
- GetItemAttachmentAllocationCost()Gets the allocation cost of an attachment for a particular item
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).