Sensors
Contains functions for detecting Entity or Player.
Functions
getPlayerDisplacement(radius, client)
Returns displacement of Player. If no player specified, the closest one will be used.
Parameters
- radius — Radius of check (optional).
- client — Player to look for (optional).
Returns
Displacement vector. Empty vector if no players found.
getEntityDisplacement(radius, entity)
Returns displacement of Entity. If no entity specified, the closest one will be used.
Parameters
- radius — Radius of check (optional).
- entity — Entity to look for (optional).
Returns
Displacement vector. Empty vector if no entities found.
getEntityCategoryDisplacement(radius, categoryType)
Returns displacement of entity of specified CategoryType.
Parameters
- radius — Radius of check (optional).
- categoryType — CategoryType to look for.
Returns
Displacement vector. Empty vector if no entities found.
Radar Functions
radar.detectsPlayer(radius, client)
Checks if radar sensor detects player.
Parameters
- radius — Radius of check (optional).
- client — Player to look for (optional).
Returns
True if player was detected.
radar.detectsEntity(radius, entity)
Checks if radar sensor detects entity.
Parameters
- radius — Radius of check (optional).
- entity — Entity to look for (optional).
Returns
True if entity was detected.
radar.detectsEntityCategory(radius, categoryType)
Checks if radar sensor detects entity of specified CategoryType.
Parameters
- radius — Radius of check (optional).
- categoryType — CategoryType to look for.
Returns
True if entity was detected.
Side Functions
side.detectsPlayer(side, client)
Checks if the player is nearby.
Parameters
Returns
True if player was detected.
side.detectsEntity(side, entity)
Checks if the entity is nearby.
Parameters
Returns
True if entity was detected.
side.detectsEntityCategory(side, categoryType)
Checks if the player is nearby.
Parameters
Returns
True if entity was detected.
Laser Functions
laser.detectsPlayer(side, length, client)
Casts laser in direction of Bearing to detect Player.
Parameters
- side — Bearing of the detection.
- length — Laser length (optional).
- client — Player to look for (optional).
Returns
True if player was detected.
laser.detectsEntity(side, length, entity)
Casts laser in direction of Bearing to detect Entity.
Parameters
- side — Bearing of the detection.
- length — Laser length (optional).
- entity — Entity to look for (optional).
Returns
True if entity was detected.
laser.detectsEntityCategory(side, length, categoryType)
Casts laser in direction of Bearing to detect entity of CategoryType.
Parameters
- side — Bearing of the detection.
- length — Laser length (optional).
- categoryType — CategoryType to look for.
Returns
True if entity was detected.
Sight Functions
sight.detectsPlayer(angle, length, client)
Detects Player and checks if it is within a vision cone.
Parameters
- angle — Vision cone angle.
- length — Maximum length (optional).
- client — Player to look for (optional).
Returns
True if player was detected.
sight.detectsEntity(angle, length, entity)
Casts laser in direction of Bearing to detect Entity.
Parameters
- angle — Vision cone angle.
- length — Maximum length (optional).
- entity — Entity to look for (optional).
Returns
True if entity was detected.
sight.detectsEntityCategory(angle, length, categoryType)
Casts laser in direction of Bearing to detect entity of CategoryType.
Parameters
- angle — Vision cone angle.
- length — Maximum length (optional).
- categoryType — CategoryType to look for.
Returns
True if entity was detected.