FiveM CCTV script: how security cameras work
A FiveM CCTV script puts security cameras into the world for players to watch from a tablet. Players place them, share access with others and get an alert when someone walks past. If you were looking for a freecam to film your server or take screenshots, that’s a different kind of camera script.
Our CCTV Camera System runs on ESX, Qbox and QBCore. Every value in this guide is a shipped default in its config, and you can change all of them.
How a camera gets placed
- A player uses a camera item and aims at a spot within 10 metres.
- They rotate it, fine-tune its position and height, confirm with E and give it a name. Mounting takes 5 seconds.
- The camera now belongs to them, and only they can watch it until they share it.
You can block areas with Config, where players get “Can’t place camera here”. Each camera type also has a jobs list. Fill it, and only those jobs from the grade you set can place that type.
Placed cameras are saved in the server’s own key-value storage, not in your database. Keep the folder name tk_cctv, or the server won’t find them.
The three camera types
| Type | Item | View | Zoom (FOV) | Night vision | Motion alerts | Shot out | Hackable |
|---|---|---|---|---|---|---|---|
| Faulty | cctv_faulty |
Fixed | 60 to 90 | No | No | Yes | Yes |
| Default | cctv_default |
Full 360 | 20 to 90 | No | Yes | Yes | No |
| Advanced | cctv_advanced |
Turns within a set range | 20 to 90 | Yes | Yes | No | No |
Each type is one block in Config, with its own item and prop. Copy a block to add another type.
Watching from the tablet
Players open the tablet with the cctv_tablet item, or with /camtablet while they carry it. Set Config to let the command work without the item. The tablet lists each camera they can use, with its ID, name and distance, plus search and filters.
- Watching. They zoom, toggle night vision where the type has it, and switch between cameras in the same group.
- Sharing. The owner gives access to a player by ID, or to a job from a minimum grade. Full permissions also let that person rename, regroup, share and remove the camera. The owner can hand the camera over to another player, too.
- No recording. The tablet shows live views only, so nothing can be played back later.
- Advanced Laptop. The tablet also opens as the CCTV app on our laptop script, which is sold separately.
- Your own scripts. The client export
openCameraTabletopens the tablet, and the server exportaddAccessToCameragives access. A security job could hand out access that way.
Motion alerts, damage and hacking
Motion alerts. Every type except the faulty one alerts the owner and everyone with access when a player comes within 20 metres in clear sight. A camera that turns within a set range only sees what’s in front of it. Each camera alerts once every 2 minutes at most. The alert is a notification, and you can send it somewhere else, such as your dispatch, by editing MotionDetectedAlert in client/.
Damage. Players can shoot out faulty and default cameras. As shipped, cctv_advanced cameras can’t be destroyed. A destroyed camera shows a black screen until someone with access repairs it within 10 metres, which takes 10 seconds. If a type has canBeRepaired = false, its cameras disappear when destroyed.
Hacking. Only the faulty camera is hackable as shipped. A player within 30 metres sees it on their tablet with a Hack button. No hack minigame comes with the script, so every hack fails until you add one to HackCameraMinigame in client/. A successful hack opens the view once. Set Config to give lasting access instead.
Police. Jobs in Config can remove any camera within 10 metres, without viewing it. It ships with police from grade 0. Whoever removes a camera gets its item back.
What to check before you choose
- Your inventory. The four items go through your framework’s item functions.
READMEhas item lists for ox_inventory, qs-inventory and qb-core, and how to add items to ox_inventory shows where they go..txt - A hack minigame. Add one you already run, or set
hackable = falseon the faulty type. - Live only. If your players expect footage they can rewind, this script doesn’t record.
- Clearing every camera. Run
removecamerasin the server console, then restarttk_cctvstraight away. - The setup. The CCTV docs cover hacking, alerts and access in more detail.
- See it in game. The showcase on YouTube runs 4:01.
CCTV Camera System is sold on its own, and it’s also in our Ultimate plan, which “Includes ALL current scripts and ALL future releases”. Compare the plans if you run several of our scripts.
