- Documentation
- Shared functions
- getElementsWithinColShape
Function
getElementsWithinColShape
Returns the elements inside a collision shape, optionally of one type only.
Syntax
table getElementsWithinColShape(colshape theShape [, string elemType = nil])Arguments
theShapecolshape- The shape.
elemTypestring, optional = nil- Element type.
Returns
A table of elements.
Example
local zone = createColSphere(2495, -1687, 13, 30)
addCommandHandler("obecni", function(player)
outputChatBox("Na Grove: " .. #getElementsWithinColShape(zone, "player"), player)
end)
See also
isElementWithinColShapeChecks whether an element is currently inside a collision shape.createColSphereCreates a sphere-shaped collision zone. The zone is invisible; when a player enters or leaves it,onColShapeHit/onColShapeLeavefire (server) oronClientColShapeHit/onClientColShapeLeave(client). A zone can be attached to an element (attachElements) so it moves with it.