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
| Name | Type | Description |
|---|---|---|
| colShape | element | The collision shape it entered. |
| matchingDimension | bool | Whether 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)