TF2 Optimizing Performance with Scripts Guide

TF2 Optimizing Performance with Scripts Guide by Archmage MC

A few scripts to help optimize the performance of TF2 using .cfg files. (AKA script files that VALVe says are ok to use.)


This is a guide on how to optimize TF2 performance with scripts, as well as having a few other scripts that most professional TF2 players use.

Now all CFG/scripts are optional, but they do help give a more optimal TF2 experience.

Network Optimization Script and How To

1. Go into your C:\Program Files\Steam\Steamapps\Common]Team Fortress 2\tf\custom\My Custom Stuff\cfg folder (Or create all missing folders)

2. Make a new text file named Autoexec

3. Change the file extension to .cfg
-See Question 3 if you need to enable viewing of known file extensions.

4. Open the file using Notepad or other text editors.
-See Question 4 if your computer doesn’t know what to use in order to open the .cfg you just made.

5. Add these lines to the .cfg file.
cl_updaterate 100
cl_cmdrate 100
rate 60000
cl_interp_ratio -1
cl_interp .015
cl_smooth 0
cl_smoothtime 0

6. Save

7. Restart TF2 if it was already open.

8. Enjoy having optimized network settings

What this does is optimize how your computer talks to the TF2 servers. This makes hits register better and hits made against you be more accurite, or it helps solve those “I was shot behind a wall” moment. It doesn’t remove them, but makes them less likely.

Automatic Jump Crouch Script

This is optional, but makes you more difficult to hit when jumping, especially by snipers.

1. Go into your C:\Program Files\Steam\Steamapps\Common]Team Fortress 2\tf\custom\My Custom Stuff\cfg folder (Or create all missing folders)

2. Make new text files named Demoman, Engineer, Heavyweapons, Medic, Pyro, Scout, Sniper, Soldier, Spy and Default

3. Change the extension to all of these files to .cfg

4. Place this line in each class cfg (the Demoman,Engineer, Heavyweapons, Medic, Pyro, Scout, Sniper, Soldier, Spy files you just made.)
exec Default

5. Add these lines to the Default.cfg
alias “+jumpehs” “+jump; +duck”
alias “-jumpehs” “-duck; -jump”
bind “space” “+jumpehs”

5b Alternately you can add the above script into each class .cfg separately.

6. Save each one you complete.

7. Restart TF2

8. Now whenever you jump, you also crouch. Pushing space twice will make you crouch twice in the air, causing your hitbox to become very distorted and making you harder to hit/track.

Block Pinion and Malicous Servers Script

1. Go into your C:\Program Files\Steam\Steamapps\Common]Team Fortress 2\tf\custom\My Custom Stuff\cfg folder (Or create all missing folders)

2. Create a text file named Protect

3. Change the extension to .cfg

4. Open the file and add these lines to it.
*Not made by me.
// TF2 Anti-Virus by Casual v1.0

// Protection against server_can_execute bypass
// Make your cfg/config.cfg read-only for extra protection
cl_allowupload 1
alias cl_allowupload “echo Blocked cl_allowupload!”
alias clear “echo Blocked clear!”
alias unbindall “echo Blocked unbindall!”

// Adblock for motd, extra protection:
// > Create an empty file in your tf directory named textwindow_temp.html and make it read-only (this prevents the motd from being saved & loaded)
// > Add ‘’ to your hosts file. This prevents a well known motd advertising network to load
cl_disablehtmlmotd 1
alias closed_htmlpage “echo Blocked pinion!”

// Gets rid of servers playing annoying sound files
//alias play “echo Blocked play!”
//alias sndplaydelay “echo Blocked sndplaydelay!”
//alias playgamesound “echo Blocked playgamesound!”
//alias soundfade “echo Blocked soundfade!”

// Servers don’t need this
alias cl_spec_mode
alias rpt_connect
alias r_screenoverlay

*Note: the // excludes a line from being read as a script by the game. Remove // if you want to enable that line, but its not recommended. For example, if you enable the Alias play, Alias sndplaydelay, alias playgamesound, and alias soundfade lines, game music will be turned off.

*Note: If you make your config.cfg Read Only, you will be unable to save new keybinds, options set in the option menu, completed tutorials, and the like.

5. Save

6. Add this line to Autoexec.cfg, it doesn’t matter where as long as its on its own line.
exec Protect

7. Save

8. Restart TF2

9. Enjoy Pinion not being as big of an annoyance, as well as being protected from a lot of malicious server commands.

I did not make the above script, however I am unaware of the name of the original author. If someone knows, please post it in the comments.

Class Scripts

Scripts in this section are Optional, but may help you be better at doing things with a class at the cost of something else. Each script will say what it does and what it might stop you from doing.

Note: This Section might say things in the script such as <Your Default Sensitivy Here> (Don’t include the < or > when placing the number here). This is asking for the mouse sensitivy option you have in your options > mouse tab in TF2.

Note: This section might say things like <your Field of View here> (Don’t include the < or > when placing the number here). This is asking for your field of view in your Options > Multiplayer > Advanced(button) and your Options > Video > Advanced(button) in TF2. The guide will specify which location to search for these options. If you want the ‘optimal’ settings or the settings most pro players use…

The Options > Video > Advanced(button) FoV is set to 90 or max
The Options > Muliplayer > Advanced(button) Field of View is set to 75 or max.

This section is for scripts for various classes. To place these scripts, you must place them in the correct class .cfg file, creating them if they don’t exist. These files would be…

demoman.cfg = Demoman
engineer.cfg = Engineer
Heavyweapons.cfg = Heavy
Medic.cfg = Medic
Pyro.cfg = Pyro
Scout.cfg = Scout
Soldier.cfg = Soldier
Sniper.cfg = Sniper
Spy.cfg = Spy

Note: If a script rebinds a key that is used by all classes, such as Attack1, you will need to set a script in the default.cfg file that you created earlier in this guide, or rebind the key correclty in all other class .cfgs, otherwise it’ll stay what that script bound it to.

Here is a quick ‘rebind all to default’ script you can place in the default.cfg. Place this at the top of the default.cfg script if you have something else posted in there.

If you have changed your keybinds to something else other than the listed keys in this script, change those keys in this script as well, otherwise they will be set to what this script says everytime you switch classes.
developer 1
echo “default settings loaded”
developer 0

bind “0” “slot10”
bind “1” “slot1”
bind “2” “slot2”
bind “3” “slot3”
bind “4” “slot4”
bind “5” “slot5”
bind “q” “lastinv”

bind “mouse1” “+attack”
bind “mouse2” “+attack2”
bind “mouse3” “+attack3”

bind “a” “+moveleft”
bind “d” “+moveright”
bind “s” “+back”
bind “w” “+forward”
bind “SPACE” “+jump”
bind “ctrl” “+duck”
bind “v” “+voicerecord”
bind “y” “say”
bind “u” “say_team”
bind “z” “voice_menu_1”
bind “x” “voice_menu_2”
bind “c” “voice_menu_3”
bind “e” “voicemenu 0 0”
bind “‘” “+moveup”
bind “/” “+movedown”
bind “,” “changeclass”
bind “.” “changeteam”
bind “m” “open_charinfo_direct”
bind “n” “open_charinfo_backpack”
bind “l” “dropitem”
bind “g” “taunt”
bind “h” “+use_action_slot_item”
bind “i” “showmapinfo”
bind “f” “inspect”
bind “r” “+reload”
bind “t” “impulse 201”
bind “tab” “+showscores”
bind “f5” “screenshot”
bind “f6” “save_replay”
bind “f12” “replay_togglereplaytips”
bind “`” “toggleconsole”
bind “f3” “askconnect_accept”
bind “j” “cl_trigger_first_notification”
bind “k” “cl_decline_first_notification”
bind “pgup” “+lookup”
bind “pgdn” “+lookdown”



Coming Soon…



Coming Soon…



Coming Soon…



Coming Soon…



Coming Soon…



Coming Soon…



Coming Soon…



Coming Soon…



Ambassidor Zoom Script

-What it does.
This script allows you to ‘zoom in’ your Ambassidor by changing your FoV setting to the lowest it can go on keypress and reducing your sensetivity so you can have a more precise aim, and restoring them to your default settings when the key is released.

-Misc info
Default key is Shift, but this can be changed by changing the key you want it to use.
Can also be used while sniping to help you have a more accurate shot, but will take quite a bit of getting used to. If you want to use it for sniping, add it to your sniper.cfg as well.

alias +zoom “fov_desired 75; viewmodel_fov 54; viewmodel_fov_demo 54; sensitivity 0.5”
alias -zoom “fov_desired <Your Field of View here (Video>Advanced)>; Viewmodel_fov <Your Field of View here (Multiplayer>Advanced)>; viewmodel_fov_demo <Your Filed of View here (Multiplayer>Advanced); current_sens”

bind shift +zoom


Q1. What do all of these scripts do?

A1. The first script optimizes the TF2 network settings. This means that you will be able to hit people more reliably, be hit a bit less often since you update your position better, and everyone will be a little smoother in movemeny.
-The Second Script helps you Duckjump, a technique used by high level competitive players to make them harder to hit and track. The downside is that its more difficult to do jumping Rocket/sticky jumps as you always crouch when you jump.
-The Third Script blocks a lot of commands that Pinion and malicious servers use to annoy you or break your game.
-Class Scripts help automate what you want to do. For some classes this is preferred over doing it yourself, but for other classes it is detrimental. What each class script does and if its good or bad for your game will be listed under the script.

Q2. Wont I get banned for using scripts?

A2. No. These are commands that Valve allows you to use. You will only be banned for using external programs on VAC secured games. (IE, Cheat Engine)

Q3. How do I enable viewing Known File Extensions?

A3. Go into your Control Panel > Folder Options > View. Scroll down the list that is given until you see a checkbox that says “Hide Known File Extensions”. Uncheck this. Hit Apply and Ok and now you should see the file extensions of all known file types.

*Note: Do NOT change a file extension unless specified in this guide, otherwise the file may not work correctly. Windows will tell you this when you attempt to do so.

Q4. How do I open a .cfg file in a Text editor? My Computer says it doesn’t know what to open that file with.

A4. Click the bubble that says “I’ll choose what program to open this file with.” Once there, click the down arrow to show a bunch of programs. Click on the program that says “Notepad”. Click ok. Now you should have the .cfg opened up in Notepad.

Q5. Where does my Hosts file go to block pinion?

A5. The hosts file goes in C:\Windows\System32\Drivers\etc. You can’t edit that file directly, but must copy it to your desktop or documents, edit it there, then replace the hosts file in that system32 location.

Q6. Where do I navigate to on a MAC to create .cfg files?

A6. ~/Library/Application Support/Steam/SteamApps/common/Team Fortress 2/tf/cfg
~/Library/Application Support/Steam/SteamApps/common/Team Fortress 2/tf/custom/configs/cfg

Either one, making the paths if not avalable, but the second one will have more cfg success.

Q7: My Program Files folder doesn’t have a Steam folder, what do I do?

A7: Don’t panic, this probably means you have a 64 bit operating system. This means that your Steam Folder is installed in your Program Files(x86) folder instead.

Q8: My CFG files don’t work, whats wrong?

A8: After the Steampipe update, TF2 usually will associate custom files in the location I game (tf/custom/mycustomstuff) However sometimes it might read files like it did prior to the Steampipe update for some odd reason, mostly config and resource files. To fix this, place your .cfg files in your steam/steamapps/common/Team Fortress 2/tf/cfg folder. If the scripts still don’t work, leave a comment explaining what you did and I’ll try to troubleshoot it.

Q9: After using your scripts, some servers say that I have “ping masking” enabled and they kick me from them when I join.

A9: If this is a server you used to frequent or want to frequent, place // in front of the autoexec lines cl_updaterate 100 and cl_cmdrate 100, or change them to values of 66.


Please place any comments/Suggestons/Questions in the comments and I’ll answer them when I can. If you want to suggest a class script, make sure it does not use the WAIT command.

Other Team Fortress 2 Articles

Leave a Reply