Left 4 Dead 2

Left 4 Dead 2

114 ratings
[VScript] Unscope on Shoot (For Bolt Actions)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Weapons: Sniper
File Size
Posted
Updated
10.734 KB
5 Jul @ 4:29am
25 Aug @ 4:54pm
6 Change Notes ( view )

Subscribe to download
[VScript] Unscope on Shoot (For Bolt Actions)

In 1 collection by ChapCanai
Counter Strikey Weapon Set
47 items
Description
Zoom back out after firing the Scout and AWP, to kinda follow counter strike.

You can also toggle/change the delay of re-zooming after shooting

The settings are in \Left 4 Dead 2\left4dead2\ems\unscope_on_shoot_for_bolt_actions

Other scoped weapons are not affected, but you can add/remove them in here too, if you want.

(Only for singleplayer and your local server)

Credits:
VSCode - IDE
marcinbar - VSCode Squirrel Ext
devlos & chatgpt - ParseSettings code
kurochama - Improvements
22 Comments
AVGyerra 31 Aug @ 9:06am 
Works like a charm now!
ChapCanai  [author] 25 Aug @ 6:57am 
@kurochama
Thank you, I can try that way instead of pressing the zoom button for the player to unscope
kurochama 25 Aug @ 6:02am 
There's a little hint that might be helpful: NetProps.GetPropInt(player, "m_iFOV") .This netprops is to detect whether a player is using scrope. The value "0" is normal state (unscoped) while value above 0 is scoped state. Normally, you can simply just use "weapon_fire" event function, & then use "if" with the netprops above. For example, you can also write it like this on the "weapon_fire":
//Example for awp
if(player.GetActiveWeapon().GetClassname() == "weapon_sniper_awp")
{
if(NetProps.GetPropInt(player, "m_iFOV") != 0)
{
NetProps.SetPropInt(player, "m_iFOV", 0);
}

}

This will automatically cancel scope after firing. If you want to implement auto scoping after unscoping like that on CS, you can use that netprops on "EntFire", & put it on the "weapon_fire" as well.
ChapCanai  [author] 22 Aug @ 1:29am 
I forgot to ask, does any error appear in the console after shooting while scoped?
ChapCanai  [author] 20 Aug @ 5:32pm 
@AVGyerra
It works for me, no idea why doesnt work for some
AVGyerra 20 Aug @ 12:19pm 
Hmmm, this also doesn't work for me.
Xav1eRRz 5 Aug @ 3:30pm 
Nice bro 🤝
󠁳 3 Aug @ 1:45am 
well this is pretty odd, idk what would be making this script to stop working for me, bad luck ig
ChapCanai  [author] 3 Aug @ 1:34am 
Im testing it right now, working for me
󠁳 3 Aug @ 1:31am 
yeah well, i dont know either, sad