Configuration

βš™οΈ Config

The following configuration options are available in shared/config.lua:


config.TestingMode (boolean):

Enable debug commands for testing purposes. Set to false for production.

Using TestingMode can help you find values you will need for setting the rotationLimits e.g. You can see the current Heading you are looking at in the top right and the Height.


config.AutoExitEnabled and config.AutoExitTime = 300

Both of these two options work with each other. AutoExitEnabled will enable the feature to kick the player out of the security cameras after a select amount of second which is defined by AutoExitTime .


config.Cameras

The config.Cameras array allows you to set up an advanced security camera system in your scripts.

Each camera configuration includes a unique ID which must be an integer, name, location and hardware features like night vision and thermal modes.

You can specify the camera's positional and rotational vectors, as well as rotation limits to restrict its viewing angles. Additionally, each camera can have interactive props associated with it, triggering specific minigame events when interacted with, such as disabling door locks or accessing codes for heists.

The interactiveProps field specifies the position, model hash, interaction text, and highlight color, along with parameters for the hack minigame, making this a versatile and customizable setup for simulating sophisticated security operations.


⬆️ Exports

The following exports are available for use in your scripts:

Camera Control Exports

EnterCameraMode(cameraIndex, allowed)

Switches the player's view to a security camera, enabling camera mode and associated UI elements.

Parameter
Default
Description

cameraIndex

nil

The initial camera the player will see when entering the security cameras

allowedCameras

All Cameras

A table containing the ids of the cameras you want the player to be able to access. e.g. {1,2,4,5,}

ExitCameraMode()

Returns the player's view to normal and disables camera mode, removing associated UI elements.

  • This is handled automatically by the script but can also be used manually

SwitchCamera(cameraIndex)

Changes the current view to a different security camera by its ID.

  • This is handled automatically by the script but can also be used manually

Parameter
Default
Description

cameraIndex

nil

The initial camera the player will see when entering the security cameras

AttemptCameraHack(cameraIndex, propId, allowedCameras)

This will trigger the export you set for HackExport when defining the camera and return true or false in most cases but can also return whatever the export is setup to return.

Parameter
Default
Description

cameraIndex

nil

The initial camera the player will see when entering the security cameras

propId

nil

The prop which the player will be able to hack. This should be the string which is in propUniqueId from when you created the camera.

allowedCameras

All Cameras

A table containing the ids of the cameras you want the player to be able to access. e.g. {1,2,4,5,}


Camera Management Exports

AddCamera(cameraData)

Adds a new camera to the security system with specified parameters. CameraData would be like this

RemoveCamera(cameraId)

Removes a camera from the security system by its ID.

GetAllCameras()

Returns a list of all cameras in the security system.

GetCameraById(cameraId)

Retrieves a specific camera's data by its ID.


How to set up camera rotationLimits?

To setup the camera rotation limits we must first recognize that the x values are -180 to 180 and the z values are 360 degrees. Knowing this we have then included a built-in debug mode which can be toggled on by setting Config.TestingMode to true. Doing this and then going into a camera will display the current heading and height of where the camera is looking.

By using this information, we can look at where we want the camera rotation limits to be. We then enter the heading/height into rotationLimits and thus lock the cameras view into a certain area. You must set the rotation of the camera to be looking at a position which is within the two degrees you want the camera to move between e.g. rotation = vector3(-10.0, 0.0, playerHeading), -- Camera rotation So here you would set playerHeading to be your characters heading when looking in the direction you want the camera to be looking initially. Once again, this MUST between the two degrees you have set for the boundary.

Last updated