# WarriorsLib.GarrisonWarriors

## `WarriorsLib.GarrisonWarriors(buldingid, player)`

Garrison a building. This makes a military building to search nearby units and when found command them to enter the specified building to completely occupy all spots in the building.

#### return value

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

```lua
WarriorsLib.GarrisonWarriors(Buildings.GetFirstBuilding(1, Buildings.GUARDTOWERSMALL),1)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.settlers-united.com/s4-warriorslib-en/warriorslib-functions/warriorslib.garrisonwarriors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
