OnWorldItemPickup
onWorldItemPickup
Triggered after the server validates a synchronized world-item pickup.
Availability
This event is available in server-side scripts.
Callback signature
onWorldItemPickup(objectId, playerId, itemKey, quantityRemaining, serverTimeMs)
Parameters
| Name | Type | Description |
|---|---|---|
objectId |
int |
The world-item object ID. |
playerId |
int |
The player that picked up the item. |
itemKey |
string |
The stable item definition key. |
quantityRemaining |
int |
Quantity left in the world after pickup. |
serverTimeMs |
int |
Server timestamp of the accepted pickup. |
Examples
Handle the event:
addEventHandler("onWorldItemPickup", root, function(objectId, playerId, itemKey, quantityRemaining, serverTimeMs)
outputDebugString(getPlayerName(playerId) .. " picked up " .. itemKey)
end)
Notes
- When quantity reaches zero, clients remove the synchronized pickup from the world.