- Documentation
- Server functions
- usePickup
Function
usePickup
Collects a pickup manually, as if a player walked into it: gives the contents, fires onPickupUse and hides the pickup for its respawn time. Without a player the pickup is only hidden.
Syntax
bool usePickup(pickup thePickup [, player thePlayer = nil])Arguments
thePickuppickup- The pickup.
thePlayerplayer, optional = nil- The collecting player.
Returns
true on success.
Example
local medkit = createPickup(2495, -1660, 13.5, 0, 100)
addCommandHandler("apteczka", function(player)
if isPickupSpawned(medkit) then usePickup(medkit, player) end
end)