- Documentation
- Pickups
Category
Pickups
All Lua functions and events in the Pickups category, on the server and the client.
Server functions 6
getReturns the time (ms) after which a collected pickup comes back.Pickup Respawn Interval isChecks whether a pickup is currently visible and collectable (rather than waiting to come back after being collected).Pickup Spawned setChanges the amount of ammo in a weapon pickup.Pickup Ammo setSets the time (ms) after which a collected pickup reappears.Pickup Respawn Interval setChanges an existing pickup's type and contents without recreating it.Pickup Type amountandammomean the same as increatePickup.useCollects a pickup manually, as if a player walked into it: gives the contents, firesPickup onPickupUseand hides the pickup for its respawn time. Without a player the pickup is only hidden.
Shared functions 5
createCreates a pickup: a spinning item to collect - a health pack, body armour, a weapon or any model (e.g. a building entrance icon). A player collects it by walking into it; the server then firesPickup onPickupHit(cancelEvent()there stops the collection), and the pickup hides forrespawnIntervaland comes back. The meaning ofamountdepends on the type: health or armour to add, a weapon ID, or a model ID.getReturns the amount of ammo in a weapon pickup.Pickup Ammo getReturns the health or armour points given by a type 0 or 1 pickup.Pickup Amount getReturns the pickup type: 0 health, 1 armour, 2 weapon, 3 custom model.Pickup Type getReturns the weapon ID of a type 2 pickup.Pickup Weapon
Server events 5
onA player walked into a pickup. You can block the pickup.Pickup Hit onA pickup appeared again after its respawn time.Pickup Spawn onA player picked up a pickup (got health, armour or a weapon).Pickup Use onA player walked into a pickup (the version from the player side).Player Pickup Hit onA player picked up a pickup (the version from the player side).Player Pickup Use