onColShapeLeave
Client-side
Server-side
Shared
This event is triggered when a player or a vehicle leaves a collision shape.
Parameters
element leaveElement, bool matchingDimension
- leaveElement: The element that who exited the col shape. This can be a player or a vehicle.
- matchingDimension: a boolean referring to whether the collision shape was in the same dimension as the element.
Source
element: The source of this event is the colshape that the element no longer is in contact with.
Code Examples
server
This example kills the player whenever they leave a certain collision shape:
local jailZone = createColCircle ( 1024, 1024, 15 ) -- create a collision shape
-- call 'jailZoneLeave' whenever a player leaves the collision shape:function jailZoneLeave ( thePlayer ) if getElementType ( thePlayer ) == "player" then -- if the element that left was player killPlayer ( thePlayer ) -- kill the player outputChatBox ( "You are not allowed to leave the jail!", thePlayer ) endendaddEventHandler ( "onColShapeLeave", jailZone, jailZoneLeave )
See Also
Colshape Events
- onClientColShapeHit
- onClientColShapeLeave
- onColShapeHit
- onColShapeLeave
Colshape Functions
- createColCircle
- addColPolygonPoint
- createColCuboid
- createColPolygon
- createColRectangle
- createColSphere
- getColPolygonPointPosition
- createColTube
- getColPolygonPoints
- getColPolygonHeight
- getColShapeSize
- getColShapeRadius
- getColShapeType
- getElementColShape
- getElementsWithinColShape
- isElementWithinColShape
- isInsideColShape
- removeColPolygonPoint
- setColPolygonHeight
- setColPolygonPointPosition
- setColShapeRadius
- setColShapeSize