# SU.Buildings.SetProduction

## SU.Buildings.SetProduction(buildingID, goodType, amount)

Gibt dem durch die ID angegebenen Gebäude den Auftrag, eine spezielle Anzahl an Waren herzustellen.

#### Notiz

* die KI stellt die Produktion der Waffenschmiede alle paar Sekunden um, somit ist diese Funktion **bei aktivierten KIs** momentan ziemlich **sinnlos**!
* funktioniert nur bei **Waffen- und Werkzeugschmieden**
* Spezialwaffen werden automatisch dem Volk entsprechend interpretiert, bspw. stellt ein Funktionsaufruf für Wikinger mit `Goods.BLOWGUN` automatisch Äxte ein, bei Römern Schwerter.

#### Parameter

* `buildingID`: ID des Gebäudes
* `goodType`: [Goods](/s4-lua-api-de/api-enums/goods.md)
* `amount [0-100]`: Anzahl, die **addiert** wird! (0=zurücksetzen, 100=unendlich)

#### Rückgabewert

* 1: erfolgreicher Aufruf (dies bedeutet nur, dass die Parameter valide waren und nicht zwingend, dass der Auftrag ausgeführt wird, z.B. wenn das Gebäude diese Ware nicht produzieren kann!)
* 0: sonst / Fehler

#### Beispiel

```lua
local success = SU.Buildings.SetProduction(buildingID, Goods.SWORD, 5)
```


---

# 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-lua-api-de/su-library-functions/su.buildings/su.buildings.setproduction.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.
