# Detectorist

{% hint style="warning" %}
Ma**ke sure to add the necessary items, item images and job names required for the job**
{% endhint %}

***

<mark style="background-color:yellow;">**\["name"]:**</mark> It is the label that will appear in menus or notifications.

<mark style="background-color:yellow;">**\[‘menu’]**</mark> variable consists of things related to the location from which the job is to be retrieved

* <mark style="background-color:orange;">\["job\_menu"]:</mark> <mark style="color:yellow;">@vector3</mark> Accepts. The menu access location of the  job.
* <mark style="background-color:orange;">\["interaction\_distance"]:</mark> <mark style="color:yellow;">@float</mark> Accepts. The player distance controlled to access the menu.

***

## 📦 Giveable / Findable Items

It is a table consisting of the items that will appear while searching the areas. You can add or remove new items.

<mark style="background-color:yellow;">**\["item\_name"]**</mark>: <mark style="color:yellow;">@object</mark> We can start creating the table structure by writing the name of the item.

* <mark style="background-color:orange;">**\["label"]**</mark>: <mark style="color:yellow;">@string</mark> Name to be displayed in the notification to be sent when the item is found.
* <mark style="background-color:orange;">**\["amount"]**</mark>: <mark style="color:yellow;">@numbe</mark>r The amount to be given to the person when the item is found. You can make it random if you want. Here is an example: `math.random(1, 3)` (but I don't recommend it).
* <mark style="background-color:yellow;">**\["rarity"]**</mark>: <mark style="color:yellow;">@float</mark> It is the probability (valence) of finding the item. I recommend making it maximum 1.0. The more the value decreases, the more valuable it becomes as a ‘Zero’ is added to its left, here are a few examples: `0.1, 0.05, 0.02.`

***

## 🚗 Car Settings&#x20;

Contains the details of the operator vehicle. You can enter spawn location and vehicle type.

* <mark style="background-color:orange;">\["model"]:</mark> <mark style="color:yellow;">@string</mark> You can enter the vehicle model here. Be careful to enter a valid vehicle.
* <mark style="background-color:orange;">\["spawnCoords"]:</mark> <mark style="color:yellow;">@vector4</mark> Accepts. It is the position where the vehicle will emerge. The direction your character is facing is the direction the front of your vehicle will face.

***

## 🔩Props Settings / Detector Attach

Necessary conditions for attaching the detector to the player and the vehicle.

* <mark style="background-color:yellow;">**\["prop\_settings"]:**</mark> <mark style="color:yellow;">@object</mark> Detector attach settings.
* <mark style="background-color:yellow;">**\["prop"]**</mark>: <mark style="color:yellow;">@string</mark> It is the name of the detector model.
  * <mark style="background-color:orange;">**\["car\_attach"]**</mark><mark style="background-color:orange;">:</mark> The necessary settings for the prop to be a paperclip for the car back
    * <mark style="background-color:red;">\["bone"]:</mark> <mark style="color:yellow;">@number</mark> Select the appropriate one of the bonnets that the back have.
    * <mark style="background-color:red;">\["coords"]:</mark> <mark style="color:yellow;">@vector3</mark> It is the offset to be added to the 0.0 position of the boot.
    * <mark style="background-color:red;">\["rotation"]:</mark> <mark style="color:yellow;">@vector3</mark> The location, direction and heading settings of the Prop when attaching it to the back.
  * <mark style="background-color:orange;">**\["player\_attach:]**</mark><mark style="background-color:orange;">:</mark> Prop settings between the prop and the player.
    * <mark style="background-color:red;">\["bone"]:</mark> <mark style="color:yellow;">@number</mark> Select the appropriate one of the back that the player have. [**AltV - Ped Bones**](https://docs.altv.mp/gta/articles/ped/bones.html)
    * <mark style="background-color:red;">\["coords"]:</mark> <mark style="color:yellow;">@vector3</mark> It is the offset to be added to the 0.0 position of the player.
    * <mark style="background-color:red;">\["rotation"]:</mark> <mark style="color:yellow;">@vector3</mark> The location, direction and heading settings of the Prop when attaching it to the player.
    * <mark style="background-color:red;">\["animName"]:</mark> <mark style="color:yellow;">@string</mark> Animation name.
    * <mark style="background-color:red;">\["animDict"]:</mark> <mark style="color:yellow;">@string</mark> Animation directory name.

***

## ⏱Cooldown Timer / Animation Duration

<mark style="background-color:yellow;">**\["reset\_timer"]**</mark>: <mark style="color:yellow;">@number</mark> When you finish all item searches and excavations in a search area, it is an area-specific cooldown type so that you cannot search the area again.

<mark style="background-color:yellow;">**\["digging\_duration"]**</mark>: <mark style="color:yellow;">@number</mark> When you find a valuable item, this is the time you will animate while digging for it.

***

## 📍Detectorist Zones / Areas

It consists of areas where valuables will be searched and areas where the items are buried.

<mark style="background-color:yellow;">**\["detectorist\_zones"]**</mark>: <mark style="color:yellow;">@object</mark> Areas.

* <mark style="background-color:yellow;">**\[index]**</mark>:  <mark style="color:red;">IMPORTANT</mark> ⇒ <mark style="color:yellow;">@number</mark>  This is a area number. The maximum number of area found should be written by adding +1. If there are no area, it should start from 1.
* <mark style="background-color:yellow;">**\["zone"]**</mark>: <mark style="color:yellow;">@vector3</mark> Coordinate of the area to be searched.
* <mark style="background-color:yellow;">**\["radius"]**</mark>: <mark style="color:yellow;">@float</mark> It is the width of the area.
* In the ‘detectable\_coords’ section, the vector4 coordinate from which the valuable item will be extracted must be entered.

  ```lua
  ["detecable_coords"] = {
      [1] = vec4(0.0, 0.0, 0.0, 0.0),
  },
  ```
