Colshapes
Colshapes are server-side sphere, circle, cuboid, or cylinder trigger volumes. Detection runs from authoritative player position updates and respects dimensions.
ts
const garage = vimp.colshapes.createSphere(100, -1900, 21, 3, {
key: 'garage:entrance',
dimension: 0,
})
vimp.on('playerEnterColshape', (player, colshape) => {
if (!colshape || colshape.id !== garage?.id) return
player.emit('hud:toast', { text: 'Press E to open the garage' })
})Event payloads allow null because a shape can be destroyed between native event production and JavaScript dispatch. Always null-check before reading it.
playersInside is a live cached list. isPointInside performs a local geometry check against the current shape parameters. Neither replaces permission checks for a later client request.
Cuboid sizes are half-extents: a size of {x: 2, y: 3, z: 1} spans twice those values around the center.