Counter-Strike 2

Counter-Strike 2

240 ratings
Scripting in CS:GO
By basti
Hey, in this guide I will show you my favorite scripts in Counter-Strike:Global Offensive, and explain how they work.
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello everybody,
I am Basti and in this guide I am going to show and explain you the scripts I am using in CS:GO and how they exactly work, so you can use them or just modify them.
Since this is my first guide, I hope that you can help me to improve it. I am always happy about corrections if I made some spelling mistakes, since my native languages are German and French.
If you have any other scripts I did not mention here, I would be very thankful if you would send them to me, and I will put them in as far as I think that they are relevant for you readers :).
Whats an "autoexec.cfg"??
If you are completely new to scripting, you should start by reading this guide where Pumpkin explains you the basics of scripting.

To be able to use scripts in CS:GO you will need a file called "autoexec.cfg" .cfg is the ending for all Counter-Strike configfiles. It's being executed automatically when you start the game or if you type "exec autoexec.cfg" in your console. You need to create your autoexec like this:

  1. Go to your CS:GO cfg folder at this path:
    C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
  2. Create a new textdocument.

  3. Name it as what ever you want, then open it.
  4. Go to "Save As", then select the "cfg" folder mentioned above, and save it as autoexec.cfg, but do not forget to select all file types in the selection below.
  5. Finished! Now you have your "autoexec.cfg" which you can use for any kind of scripts.
Useful while scripting could be following links:
Keyboard Layout[http//Keyboard+Layout] ## Link was broken, searching for the picture right now
Weapon Names[pastebin.com]
"Clutch"-Script
This script can be extremely useful while making a clutch in CS:GO. It's more or less an advanced Voicetoggle, but it even toggle things like Decals or enables Gameinstructormessages to see the Bomb through for example smokes. I saw this script on reddit, it was made by Skazzy3. I will link the post below.

All you need to do is paste this in your "autoexec.cfg":

//Based on voice_chat script by bananagaming (love you maxim)
alias "clutch" "clutchon"
alias "clutchon" "voice_enable 0; clutchsoundon; gameinstructor_enable 1; cl_clearhinthistory; r_cleardecals; playvol buttons\blip2 0.5; alias clutch clutchoff; volume 1; say_team Voice Disabled, I can't hear anyone now."
alias "clutchoff" "voice_enable 1; clutchsoundoff; gameinstructor_enable 0; playvol buttons\blip1 0.5; alias clutch clutchon; volume 0.5; say_team Voice Enabled, I can hear you now."
clutchoff
bind "c" clutch

//Clutch audio options.
alias "clutchsoundon" "volume 1; snd_deathcamera_volume 0; snd_mapobjective_volume 0; snd_musicvolume 0.3; snd_roundend_volume 0; snd_roundstart_volume 0; snd_tensecondwarning_volume 1"
alias "clutchsoundoff" "volume 0.5; snd_deathcamera_volume 1; snd_mapobjective_volume 1; snd_musicvolume 0.7; snd_roundend_volume 1; snd_roundstart_volume 1; snd_tensecondwarning_volume 1"

In this case the whole script is binded to "c". To change this you only need to chance the Key in the "bind "KEY" clutch" line.

Script created by Skazzy3 (Reddit)
Toggle in-game Voicechat
This is one of the most useful scripst I am using at the moment. It let's you mute all teammates with just 1 key. This can help you if you got know-it teammates, but you want to clutch on your own or if you are just playing some deathmatch and some kids are playing ghastly music through the Voicechat.
All you need to do now, is copy this in your "autoexec.cfg":

alias "voiceoff" "voice_enable 0; playvol buttons\blip2 0.5; alias voice_chat chat_1; bind "RIGHTARROW" "voiceon""
alias "voiceon" "voice_enable 1; playvol buttons\blip1 0.5; alias voice_chat chat_0; bind "RIGHTARROW" "voiceoff""
bind "RIGHTARROW" "voiceoff"

Once you have done this, you may need to reload the autoexec in-game by writing "exec autoexec.cfg" in your console, and you may need to write voiceoff or voiceon in the console to activate the whole script.
Toggle all Game Sounds
With this script you can mute the whole game, this can be useful while talking to friends on Teamspeak or Skype.

All you need to do is copy this in your "autoexec.cfg":

alias "sound" "toggle volume .35 0"
bind "LEFTARROW" "sound"

~~You may change the volumes to something else since this is my perfect value.~~
Buyscript
The probably most used script in CS:GO is the regular Buyscript. This script let's you bind purchases of weapons to keys, for example you can bind [AWP+Tec9+Armour+Flashbang(x2)+HE-Grenade+Smokegrenade] to 1 key, and all of this will be bought while pressing the key. It will always buy in the order you put the items in the command, for example if you write: [Tec-9+Armour+AWP] you may not have enough money to buy the AWP anymore after having bought a Tec-9 and Armour. You will of course still be able to buy through to normal buying menu in-game.
To make your own bindings, I prepared some templates:

bind "key you want" "buy item1; buy item2; buy item3; buy item4; buy item5"

You can bind as many items on 1 key as you want.
Show Netgraph on Scoreboard
This script can be extremely useful if you want to see the netgraph sometimes, but you don't like to play with it in your face the whole time. The text will only show up while pressing TAB, but not while watching the scoreboard during Teamswitch or freezetime at the end of each game.

The whole thing will look like this while pressing nothing...



















...and like this while pressing TAB...


All you'll have to do, is copy this in your "autoexec.cfg":

net_graph "1"
net_graphheight "9999"
alias "+scorenet" "+showscores; net_graphheight 0"
alias "-scorenet" "-showscores; net_graphheight 9999"
bind "TAB" "+scorenet"
net_graph 1

If you haven't binded your scoreboard to "TAB" you may change it so both shows up the same time.
Matchmaking Map Display
########################################
########################################

Outdated since Panorama Update ._.

########################################
########################################


With this little script you will be able to see every time what map the matchmaking services have chosen for you, of course it's unnecessary if you only play Dust2 or only another map. The map is going to show up in the top left corner of your game like this:

All you need to do is copy the following into your autoexec.cfg:

developer 1
con_filter_enable 2
con_filter_text_out "game:mapgroupname"
con_filter_text "game:map"

Then in-game open your console and type: "exec autoexec.cfg", so the game loads the new file.

!!!WARNING: This will not work with the "Damage dealt" Script!!!!
Show Damage dealt
This script is working almost the same way as the "Map Display", so they are not working at the same time.
With this script you will be able to see how much damage you have dealt to your enemies during your lifetime or during the last round. It will only show up once your dead or when the next freezetime starts. This is fully working in Matchmaking, and is not bannable since it is just printing the information given in console. The whole thing will look like this:

Now you just need to copy this in your "autoexec.cfg":

developer 1
con_filter_enable 2
con_filter_text_out "Player."
con_filter_text "Damage Given"

!!!WARNING: This is not working with the "Map Display" script at the same time!!!
Anti-AFK
As the name already says, this script is great for not getting kicked during idletime. It can be extremely useful to go away for some minutes during matchmaking with your friends, other players may kick you for using this. You can then bind the scripttoggle to any key you want.

All you need to do, is copy this in your "autoexec.cfg":

alias afkON "echo Anti-AFK script Enable; say_team "Be right back guys!"; +forward; +moveleft; +left; bind "KP_UPARROW" "afkOFF""
alias afkOFF "echo Anti-AFK script Disable; say_team "I am back :)"; -forward; -moveleft; -left; bind "KP_UPARROW" "afkON""
bind "KP_UPARROW" "afkON"

In this example I used "KP_UPARROW" as binded key, that means the 8 on the Numpad of my keyboard. You can of course replace it with any key you want, the exact names of the keys can be found here []. The names of your Macrokeys if you have some can normaly be found on the sellers website or on the packaging of the product.

This script is not meant to troll teammates in competitive Matchmaking! You will get OW banned for griefing if you are idling for a long time!
Change Weaponside
This script is more made for fun than for anything else. It simply helps you to switch from left- to righthand during the game without typing to command in your console.

All you need to do, is copy this into your "autoexec.cfg":

alias righthand1 "cl_righthand 1; bind "UPARROW" "righthand0""
alias righthand0 "cl_righthand 0; bind "UPARROW" "righthand1""
bind "UPARROW" "righthand0"

I used "UPARROW" in the example, you can of course change it to whatever your want.
B-Hop using mousewheel
Many people in CS:GO like to bunnyhop, mostly just for fun. I am one of these players, so I made this little script to easily be able to switch between jumping with the mousewheel (makes b-hopping a lot easier) and switching your weapons.
All you need to do is copy this in your "autoexec.cfg":

alias bhopon "echo BunnyHopscript enabled; bind "MWHEELDOWN" "+jump"; bind "MWHEELUP" "+jump"; bind "h" "bhopoff""
alias bhopoff "echo BunnyHopscript disabled; bind "MWHEELDOWN" "invnext"; bind "MWHEELUP" "invprev"; bind "h" "bhopon""

You may have to reload your autoexec by writing "exec autoexec.cfg" in your console, and you will have to activate this script by typing bhopon or bhopoff in your console aswell.

This Script is not banable. It's just changing the Jumpkey to your Mousewheel, it's easier to spam the Mousewheel while scrolling than tapping the Spacebutton.
Jumpthrow grenades
For some tactical smokes or flashbangs you will have to throw your grenade at the perfect time, mostly in the top part of your jump. Because it's very hard to throw every smoke exactly the same way, I made this script which let's your throw the smoke the moment you reach the highest point of your jump.
All you need to do, is copy this in your "autoexec.cfg":

alias +jthrow "+jump; -attack; bind "j" "-jthrow""
alias -jthrow "-jump; bind "j" "+jthrow""

In this example I binded the whole thing to "j" which is easy to recognize because of J for Jumpthrow :). Now you will need to activate the script by typing -jthrow in your console.

To use the script, you will need to take out the grenade you wanna throw, then already hold leftclick, then press J (or the key you binded it to) 2 times. Sometimes there is a glitch that you can't jump anymore, all you need to do is pressing the key you binded it to once more, this should solve it.
Closing Remarks
! ! ! None of these Scripts are banable! I would never post something not allowed in here! ! ! !

I already want to thank all of you for reading this guide. The time I was writing it, I never thought that I would get more than 100 views, now we are at more than 17000!!! I love you so much for this :)
Now I hope that I was able to help you with my guide. As I already said, I will try to keep it up to date all the time and I am happy about any new script ideas you send me :).
If you got anymore questions, feel free to add and ask me, I will try to help you as soon as I can!
If you have some questions about the game, or got some good topics to write a guide about, just tell me and I will see what I can do, still got a lot of time for that!
You can download my own autoexec {LINK REMOVED}!
You can download my font pack here[bananagaming.tv]!
Don't forget to leave a Rating and maybe a fav :3
Also if you really want to support me, I will always be happy about some trading cards \(^_^)/

https://steamcommunity.com/tradeoffer/new/?partner=117682814&token=xJKlxQ8g

Greetings,
Basti
Update Notes
3rd Sep 2019
- Removed broken link

6th Feb 2019
- Content updates

7th Nov 2018
- Removed broken link

21st Dec 2015
- Removed Advertisement

9th Dec 2015
- Updated Toggle All gamesounds Script (Thanks to errieman)

8th Dec 2015
- Updated AFK-Script (Thanks to CyberizePwnZwn729)
- Updated B-Hop Script
- Updated In-Game Voice and Toggle all Sounds Scripts
- Updated Weaponside Script
- Added trade button

7th Dec 2015
- Added Downloadlink for "autoexec.cfg"-Template
- Added Advertisement

6th Dec 2015
- "Clutch"-Script added
- Update Notes added

1st Dec 2015
- Guide published

30th Nov 2015
- Guide Created
100 Comments
basti  [author] Mar 30, 2019 @ 12:47pm 
Hi Chappie, if you don't want the game instructor messages just remove the "gameinstructor_enable 1;" and the "gameinstructor_enable 0;" from the script.
Is that what you meant?
If you still need help feel free to add me :)
Saudi Agent Mar 30, 2019 @ 11:41am 
Hey i have found a problem with the clutch script and i was wondering if you knew how to fix it

When you are in game and turn on the clutch script it turns on hints and you get told how to reload or how to defuse the bomb etc and i was wondering is there something in the script to make it so it does not turn on hints in game ?
basti  [author] Oct 19, 2017 @ 2:27am 
Of course it is completely legal! Actually everything you are able to do ingame without other programs ( except some Bugs ) is legal. In this case you just change the Sound settings and turn on the game instructor messages, which you can also do in the settings :)
For any other questions feel free to add me and i'll help you as good as i can :)
Just somebody...... Oct 15, 2017 @ 9:20pm 
Is the clutch script legal? From the way I see it, it seems somewhat illegal and I really don't want my account to be banned. If it's legal I might as well give it a shot
730 Jul 29, 2017 @ 6:39am 
awesome ;]
basti  [author] Jan 18, 2017 @ 7:58am 
np :)
Baggot Jan 16, 2017 @ 11:57am 
i figured it out but thx anyway
basti  [author] Jan 16, 2017 @ 7:47am 
Ofc there is :D add me if you want an explanation :)
Baggot Jan 15, 2017 @ 11:05pm 
Is there a way so i can click a button or 2 and it turns the bhop script on and off
MeTaL.HeaD Jan 5, 2016 @ 8:24pm 
add buy and drop script...