# Changing weapon in scripts

**URL:** <https://forums.sourceruns.org/t/changing-weapon-in-scripts/3290>\
**Category:** λ Half-Life\
**Created:** [November 15, 2018, 4:23pm UTC](https://forums.sourceruns.org/t/changing-weapon-in-scripts/3290 "2018-11-15T16:23:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Jean](https://b-cdn.sourceruns.org/letter_avatar_proxy/v4/letter/j/f07891/32.png) [@Jean\_Jean](https://forums.sourceruns.org/u/Jean_Jean)\
**Post date:** [November 15, 2018, 4:23pm UTC](https://forums.sourceruns.org/t/changing-weapon-in-scripts/3290/1 "2018-11-15T16:23:45Z")

</div>

How i put auto change weapon?(lastinv i think but im not sure) when i shoot with xbow zoom?

Where is this alias?..For example:1 shoot xbow zoom, after the script change weapon in crowbar, and so on with xbow shoots.

---

<div class="post-metadata">

**Author:** ![Ankanogradiel](https://b-cdn.sourceruns.org/user_avatar/forums.sourceruns.org/ankanogradiel/32/301_2.png) [@Ankanogradiel](https://forums.sourceruns.org/u/Ankanogradiel)\
**Post date:** [November 28, 2018, 12:39am UTC](https://forums.sourceruns.org/t/changing-weapon-in-scripts/3290/2 "2018-11-28T00:39:19Z")

</div>

Well, lastinv basically changes to the last weapon used.

Now if you need to use a specific weapon the command is "use `<entity classname>`"  
In your case that would be “use weapon\_crossbow”
