Skip to content

OnPlayerDrop

The player dropped an item and the world made a pickup of it.

The player’s own game dropped the item; the server made pickup id of it so everyone sees it lying there and anyone may take it. Nothing to veto - the dropper’s screen already shows it; a mode that wants it gone calls DestroyEntity.

function OnPlayerDrop(pid, id)
-- ...
end
Parameter Type
pid number the player
id number the new pickup entity

nothing

-- dropped items vanish after two minutes
function OnPlayerDrop(pid, id)
SetTimer(function() DestroyEntity(id) end, 120000)
end

OnPlayerPickup · DestroyEntity · GetEntityTemplate · the Items and inventory group of the index