M MY Multiplayer: Wiki
Side
Kind

onElementColShapeHit

ServerEvent

Fired on a player, ped, vehicle or object when it enters a collision shape.

addEventHandler("onElementColShapeHit", root, function(element colShape, bool matchingDimension) … end)

Handler parameters

NameTypeDescription
colShapeelementThe collision shape it entered.
matchingDimensionboolWhether the element is in the same dimension as the shape.

Source

The element that entered.

It fires right after onColShapeHit, unless a handler of that one destroyed the element.

Example

addEventHandler("onElementColShapeHit", root, function(colShape, matchingDimension)
    if colShape == safeZone and getElementType(source) == "vehicle" then
        setElementFrozen(source, true)
    end
end)

See also