Client

addSphere

Creates a spherical zone that detects when a player enters, exits, or stays inside.

Parameters

data table Zone configuration.

  • coords vector3 Center position of the sphere.

  • radius number Radius of the sphere.

  • onEnter function Called once when the player enters the zone.

  • onExit function Called once when the player leaves the zone.

  • inside function Called repeatedly while the player is inside the zone.

Returns

zone table The created zone object.

Example

local zone = fjsf.addSphere({
    coords = vector3(200.0, -800.0, 30.0),
    radius = 5.0,
    onEnter = function(zone)
        print('Entered sphere zone', zone.id)
    end,
    inside = function(zone)
        print('Inside sphere zone')
    end,
    onExit = function(zone)
        print('Exited sphere zone')
    end
})

addCylinder

Creates a cylindrical zone with radius and height limits.

Parameters

data table Zone configuration.

  • coords vector3 Center position of the cylinder.

  • radius number Radius of the cylinder.

  • height number Total height of the cylinder.

  • onEnter function Called once when the player enters the zone.

  • onExit function Called once when the player leaves the zone.

  • inside function Called repeatedly while the player is inside the zone.

Returns

zone table The created zone object.

Example


addBox

Creates a box-shaped zone with optional rotation.

Parameters

data table Zone configuration.

  • coords vector3 Center position of the box.

  • size vector3 Width, length and height of the box.

  • rotation number Rotation in degrees (Z axis).

  • onEnter function Called once when the player enters the zone.

  • onExit function Called once when the player leaves the zone.

  • inside function Called repeatedly while the player is inside the zone.

Returns

zone table The created zone object.

Example


addPoly

Creates a polygon-shaped zone using multiple points.

Parameters

data table Zone configuration.

  • points table<vector3> List of polygon corner points.

  • thickness number Vertical thickness of the zone.

  • onEnter function Called once when the player enters the zone.

  • onExit function Called once when the player leaves the zone.

  • inside function Called repeatedly while the player is inside the zone.

Returns

zone table The created zone object.

Example


removeZone

Removes an existing zone and stops all detection for it.

Parameters

zone table Zone object returned by one of the add functions.

Returns

Nothing.

Example


containsZone

Checks if specific coordinates are inside a zone.

Parameters

zone table Zone object.

coords vector3 World coordinates to check.

Returns

boolean true if the coordinates are inside the zone, otherwise false.

Example

Last updated