OnWorldItemPickup

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 22:32, 14 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.