# RD Trailers

{% embed url="<https://www.youtube.com/watch?t=11s&v=Ia2lKg-mbBQ>" %}

## Step 1 - Target Setup

The script comes with four target scripts already setup. To change target system choose the one you want from the builds folder and add it to the activeTargetBuild folder (Make sure their is only on file in the folder).

### For BT-Target

If you use bt-target there are some additional steps to follow. This is meant for the version released 09-24-2021 so any line references may be different. If you found any problems with the line references please notify me in my discord:).

#### Step 1 - client/main.lua

Add the following to line 3.

```lua
local Entitys = {}
```

Add the following to line 117.

```lua
if entity ~= 0 then
    for _, ent in pairs(Entitys) do
        if _ == entity then
            for k , v in ipairs(Entitys[_]["job"]) do 
                if v == "all" or v == PlayerJob.name then
                    if #(plyCoords - coords) <= Entitys[_]["distance"] then
                        success = true
                        SendNUIMessage({response = "validTarget", data = Entitys[_]["options"]})
                        while success and targetActive do
                            local plyCoords = GetEntityCoords(GetPlayerPed(-1))
                            local hit, coords, entity = RayCastGamePlayCamera(20.0)
                            DisablePlayerFiring(PlayerPedId(), true)
                            if (IsControlJustReleased(0, 24) or IsDisabledControlJustReleased(0, 24)) then
                                SetNuiFocus(true, true)
                                SetCursorLocation(0.5, 0.5)
                            end
                            if entity == 0 or #(plyCoords - coords) > Entitys[_]["distance"] then
                                success = false
                            end
                            Citizen.Wait(1)
                        end
                        SendNUIMessage({response = "leftTarget"})
                    end
                end
            end
        end
    end
end
```

Add the following to line 249.

```lua
function AddEntityZone(entity, parameteres)
      Entitys[entity] = parameteres
end
exports("AddEntityZone", AddEntityZone)
function RemoveEntityZone(name)
  if not Entitys[name] then return end
  Entitys[name] = nil
end
exports("RemoveEntityZone", RemoveEntityZone)
```

Change line 174.

From

```lua
TriggerEvent(data.event)
```

to

```lua
TriggerEvent(data.info.event, data.info)
```

#### Step 2 - html/js/script.js

Change line 27.

From

```javascript
$("#target-"+index).data('TargetData', item.event);
```

to

```javascript
$("#target-"+index).data('TargetData', item);
```

Change line 45.

From

```javascript
event: TargetData,
```

to

```javascript
info: TargetData,
```
