# Event and Exports

#### <mark style="color:orange;">START PUZZLE EVENT</mark>

```lua
TriggerEvent('bp_vehiclepuzzle:startPuzzle', puzzleData)
```

puzzleData   = {

* type = 'middle'  --------------->  'small', 'middle', 'big'   3 map select
* point = 0  --------------->  Points that can be earned &#x20;
* timer = second (example 120s) 2 munite
* level = Level 1 to 5
* callback = If it is true, a callback notification such as a progress bar or minigame will appear.

If you leave all information blank except for the type, everything will be generated randomly.

```lua
TriggerEvent('bp_vehiclepuzzle:startPuzzle', {type = "middle"}) 

```

In this example, it creates a random level on the middle map, and there is no time or score.

#### <mark style="color:orange;">PUZZLE CALLBACK</mark>&#x20;

```lua
    TriggerEvent('bp_vehiclepuzzle:startPuzzle', {
        type = 'middle',
        timer = 120,
        point = 0,
        level = 1,
        callback = true  
    }, function(success)
        if success then
            TriggerEvent('bp_vehiclepuzzle:notify', "Congratulations on completing the minigame", 2000, 'base', "success")
            
         
        else
            TriggerEvent('bp_vehiclepuzzle:notify', "Sorry, the minigame failed.", 2000, 'base', "error")
        end
    end)
```

#### <mark style="color:orange;">ADMIN PART EVENT</mark>

```lua
TriggerEvent('bp_vehiclepuzzle:openAdoCreate')
```
