onClientPlayerPickupHit | Multi Theft Auto: Wiki Skip to content

onClientPlayerPickupHit

Client-side
Server-side
Shared

This event triggers whenever a player hits a pickup locally.

Parameters

pickup thePickup, bool matchingDimension
  • thePickup: the pickup that was hit.
  • matchingDimension: true if thePickup is in the same dimension as the player, false otherwise.

Source

element: The source of this event is the player that hit the pickup.

Code Examples

client

This example outputs a message whenever the local player hits a pickup.

local function clientPlayerPickupHit(thePickup, matchingDimension)
outputChatBox("* You have hit a pickup!", 255, 0, 0)
end
addEventHandler("onClientPlayerPickupHit", localPlayer, clientPlayerPickupHit)

See Also