> For the complete documentation index, see [llms.txt](https://eaglepb2.gitbook.io/pb2-editor-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eaglepb2.gitbook.io/pb2-editor-manual/zh-cn/the-tools/add-trigger.md).

# 触发器工具

一触即发的战争。

触发器就有点类似行为处理器，是整个逻辑的大脑。\
在合适的位置左键 就可以生成触发器。（最好是远离任何的方块，因为你会一直点他做事情的）

![](https://2905234786-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFtCELsQWyso_e3z2wu%2F-MFtpLggkJM-Dyfb50Dh%2F-MFtuoI_pbryqDB3RfQ-%2Fimage.png?alt=media\&token=8e690049-ba45-4392-add8-17b8a37727ac)

"Enabled" = 触发器默认中是否要启用，并开始接受区域的触发。

"Max calls" = 触发器最多只能使用多少次，-1就等于无数次。

"Action # Type" = 默认不会做任何事情，一个触发器有10个动作可以“同步”执行（实际上是同一时间从上到下执行，跟代码一样）。请参阅以下网址来得知所有的指令：

{% content-ref url="/pages/-MFtDaLYwSpQzm36Qwhc" %}
[触发器表格](/pb2-editor-manual/zh-cn/the-tables/trigger-table.md)
{% endcontent-ref %}

"Edit trigger as text" = 如下图：

![](https://2905234786-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFtCELsQWyso_e3z2wu%2F-MFtpLggkJM-Dyfb50Dh%2F-MFturGPXeH2uvhA5VtY%2Fimage.png?alt=media\&token=eea8e06a-2a93-4330-a35f-345e084bf5e4)

Uid: 就是你的触发器ID\
Enabled: 触发器默认中是否要启用，并开始接受区域的触发。\
Maxcalls: 触发器最多只能使用多少次，-1就等于无数次。

以下的代码的格式大概是这样子：

```typescript
<trigger operation>("<action A>","<action B">); 
最多10次，如果没什么用到他的数值就会变成0。
```
