> For the complete documentation index, see [llms.txt](https://docs.settlers-united.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settlers-united.com/s4-warriorslib-en/warriorslib-functions/warriorslib.setbuildingworkarea.md).

# WarriorsLib.SetBuildingWorkarea

## `WarriorsLib.SetBuildingWorkarea(buildingID, x, y, player)`

Set the work area for a building. This is the same event that players can issue by clicking the target icon in the side panel of a selected building.

#### return value

* **Since Version 1.5.0**: success \[0, 1]
* Before: none

```lua
WarriorsLib.SetBuildingWorkarea(Buildings.GetFirstBuilding(3, Buildings.BARRACKS),70, 33, 3)
WarriorsLib.RecruitWarriors(Buildings.GetFirstBuilding(3, Buildings.BARRACKS), Settlers.BOWMAN_03, 5, 3)
```
