> For the complete documentation index, see [llms.txt](https://wiki.thescriptersguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.thescriptersguild.com/community/content/assets-and-kits/tsg-grantvehicleweapon.md).

# tsg grantVehicleWeapon

<figure><img src="/files/kFsqDSFNa3XnlNitRwNU" alt="Cover image"><figcaption></figcaption></figure>

`tsg grantVehicleWeapon` is a script module designed to equip vehicles with custom weaponry. It functions by assigning a demonstration weapon, sourced from a designated "yellow brain," to a target vehicle via a ping.

* [Demo video](https://www.youtube.com/watch?v=UxaFOHl-91s)
* [tsg grantVehicleWeapons (mode prefab)](https://www.halowaypoint.com/halo-infinite/ugc/modes/08eec092-a5b0-4c1d-9a18-61e13c0d58df)
* [Custom Vehicle Weapons demo (map)](https://www.halowaypoint.com/halo-infinite/ugc/maps/c9082ec4-0632-4ff8-9867-b43991ff6222)

## Weapon Assignment and Turret Logic

The module facilitates the assignment of specialized weapons to vehicles. When the script is triggered, it assigns the demonstration weapon from the yellow brain to the selected vehicle.

### Turret Compatibility

The script includes logic to handle specific vehicle configurations for mounting weaponry. For vehicles such as the Warthog and Rockethog, the assigned weapons are automatically routed to their respective turrets.

## Implementation and Customization

To provide the weapon, the script clones the weapon held by a Rockethog or Wasp to extract its Base Weapon. This Base Weapon is then added to a [Weapon Type](/scripting/nodes/variables-basic/weapon-type.md) Configuration that is provided to the vehicle.

### Networking Constraints

{% hint style="warning" %}
In networked environments, vehicles seem to only accept weapon types that are specifically flagged as vehicle weapons. Attempting to grant a standard weapon that lacks this flag may not work.
{% endhint %}

### Combat Tuning

The module offers several options for adjusting how the vehicle performs in combat:

* **Damage Adjustment:** An optional feature allows for the modification of the assigned vehicle weapon's damage.
* **Shot Cadence:** As of version 1.1.0, the `vehicleShotCadence` variable can be used to adjust the delay between shots of the assigned vehicle weapon.

***

## Source Data

* Discord thread: [tsg grantVehicleWeapon](https://discord.com/channels/220766496635224065/1422405275591376946/1422405275591376946)

#### <mark style="color:green;">Contributors</mark>

Okom


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://wiki.thescriptersguild.com/community/content/assets-and-kits/tsg-grantvehicleweapon.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.
