CreatePickup
Puts an item on the ground for everyone to see and anyone to take.
A pickup entity of ENTITY_ITEM: every client in range shows the item lying at the point; whoever takes it gets the item
(OnPlayerPickup) and the pickup is gone for everyone. item is any key of the item catalogue.
world is the virtual world (nil = the shared one). nil when the key is unknown or the world is full
([world] max_entities). The /item built-in places one in front of an admin.
Syntax
Section titled “Syntax”CreatePickup(item, x, y, z [, yaw, world])| Parameter | Type | |
|---|---|---|
item |
string | number | the item’s name, id, English name or GUID |
x |
number | metres |
y |
number | metres |
z |
number | metres |
yaw |
number | degrees (0 without) (optional) |
world |
number | the virtual world; nil = the shared one (optional) |
Returns
Section titled “Returns”number - the pickup’s entity id; nil when it could not be made
Example
Section titled “Example”-- a reward on the arena floorlocal x, y, z = GetPlayerPos(loser)local id = CreatePickup("longSwordDuel", x, y, z)if id then SetEntityData(id, "owner", winner) endSee also
Section titled “See also”OnPlayerPickup · GivePlayerItem · DestroyEntity · GetEntityTemplate · the Items and inventory group of the index
