Team Fortress 2

Team Fortress 2

149 ratings
Useful TF2 Scripts
By ciba
In this guide, I will put together some of my favorite scripts and binds for TF2. I will not be including an FPS config in this guide, as there are easier ways to read up on them and I do not currently use one.
   
Award
Favorite
Favorited
Unfavorite
Overview
In this guide, I will be listing several scripts/commands for TF2. I will not be including a FPS config, as you can make one customized to your needs here http://clugu.com/tf2mate/. The scripts listed are MY favorites and may not be your favorites as well. Please read the descriptions of the scripts/configs. Keep in mind that this is my first guide and would love to hear feedback and things I could do better in the future. Thanks to Nate Fox for the wonderful thumbnail.
Null Movement Script
When you press left and right at the same time, you stop. This makes you easier to hit. Why not just move in the direction you pressed last?
This is why I love the Null Movement Script.
This script lets you move in whatever key is pressed last. Lets say you hold down the "a" key, making you go left, then if you press "d" which would make you go right instead of stopping like with the default config.
Link(copy and paste the config): http://forums.steampowered.com/forums/showthread.php?t=2831367
If you are to lazy to go to the link just copy this.

// Null-cancelling movement script
// (prevents you from pressing two opposing directions, which causes you to stop moving)

bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright

alias +mfwd "-back;+forward;alias checkfwd +forward"
alias +mback "-forward;+back;alias checkback +back"
alias +mleft "-moveright;+moveleft;alias checkleft +moveleft"
alias +mright "-moveleft;+moveright;alias checkright +moveright"
alias -mfwd "-forward;checkback;alias checkfwd none"
alias -mback "-back;checkfwd;alias checkback none"
alias -mleft "-moveleft;checkright;alias checkleft none"
alias -mright "-moveright;checkleft;alias checkright none"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""

Posted By: zechert
You can paste this into your autoexec.cfg or in certain classes.
Hide Viewmodel Script
Many competitive players do not use viewmodels on their Primary and Secondary Weapons but show the Melee weapon. I searched the internet for a while and I found a few script that could work. The problem was, the script wouldnt show/hide weapons when I use the scroll wheel(which is how I switch weapons). After looking around a bit, I found this script that works with quickswitch(default is Q), number keys, and the scrollwheel so whatever method you use will work.
SCRIPT:
alias "primary" "slot1; r_drawviewmodel 0"
alias "secondary" "slot2; r_drawviewmodel 0"
alias "melee" "slot3; r_drawviewmodel 1"

bind "1" "primary"
bind "2" "secondary"
bind "3" "melee"

//VIEWMODEL SCRIPT
//VIEWMODEL SCRIPT
//VIEWMODEL SCRIPT
alias wep1 "slot1; wep1com; alias mouseup wep-3; alias mousedown wep2; alias quickswap wep-3; alias lastwep wep1; keybind1"
alias wep2 "slot2; wep2com; alias mouseup wep-1; alias mousedown wep3; alias quickswap wep-1; alias lastwep wep2; keybind2"
alias wep3 "slot3; wep3com; alias mouseup wep-2; alias mousedown wep1; alias quickswap wep-2; alias lastwep wep3; keybind3"
alias wep-1 "slot1; wep1com; alias mouseup wep-3; alias mousedown wep2; alias quickswap wep2; alias lastwep wep-1; keybind-1"
alias wep-2 "slot2; wep2com; alias mouseup wep-1; alias mousedown wep3; alias quickswap wep3; alias lastwep wep-2; keybind-2"
alias wep-3 "slot3; wep3com; alias mouseup wep-2; alias mousedown wep1; alias quickswap wep1; alias lastwep wep-3; keybind-3"
alias keybind1 "alias key1 wep1; alias key2 mousedown; alias key3 mouseup"
alias keybind2 "alias key1 mouseup; alias key2 wep2; alias key3 mousedown"
alias keybind3 "alias key1 mousedown; alias key2 mouseup; alias key3 wep3"
alias keybind-1 "alias key1 wep-1; alias key2 mousedown; alias key3 mouseup"
alias keybind-2 "alias key1 mouseup; alias key2 wep-2; alias key3 mousedown"
alias keybind-3 "alias key1 mousedown; alias key2 mouseup; alias key3 wep-3"
alias mouseup "wep-3"
alias mousedown "wep2"
alias quickswap "lastwep"
alias lastwep "wep2"
alias key1 "wep1"
alias key2 "mousedown"
alias key3 "mouseup"
alias key4 "slot4; extrakey"
alias key5 "slot5; extrakey"
alias extrakey "alias mouseup wep-3; alias mousedown wep1; alias quickswap lastwep; alias lastwep wep3"
// DO NOT MESS WITH THE ABOVE STUFF
// EDIT THE FOLLOWING ALIASES, SEE DESCRIPTION BELOW
alias wep1com "r_drawviewmodel 0"
alias wep2com "r_drawviewmodel 0"
alias wep3com "r_drawviewmodel 1"
//BACKUP
bind MWHEELUP mouseup
bind MWHEELDOWN mousedown
bind Q quickswap
bind 1 key1
bind 2 key2
bind 3 key3
bind 4 key4
bind 5 key5

DO NOT PASTE THIS IN SPY CONFIG, IT WILL MESS UP YOUR VIEWMODELS.
CrouchJump script
This is a pretty straight-forward script. With this, as long as you hold down spacebar, you will crouch, and if you haven't used your jump(s) yet, you will jump!

SCRIPT:
alias +rj "spec_mode;-duck;+cr;alias checkrj +cr";
alias -rj "-cr;checkduck;alias checkrj none";
alias +crouch "-cr;+duck;alias checkduck +duck";
alias -crouch "-duck;checkrj;alias checkduck none";
alias checkduck none;
alias checkrj none;
alias +cr "+jump;+duck";
alias -cr "-duck;-jump";
alias none "";
bind space +rj;
bind ctrl +crouch;
//By: Chdata

Paste this into your autoexec.cfg or in a certain class cfg.
Rocket Jump/Regen Script
This script is for all of you jumpers out there. If you want to practice your Upward jumps, but don't want to wait for your rocket launcher to reload or your health to regen. With this script, your health and ammo regen about every 2 seconds. When you get in an offline server(using the "+" button) just type "exec regen" in the console. Keep in mind that there is a second script below the first one.

SCRIPT:
//Personal portable regen for offline jumping!
sv_cheats 1

mp_tournament 1

wait 5;ent_fire !self addoutput "targetname player_me"
wait 5;ent_fire func_regenerate addoutput "classname func_regenerate_temp"
wait 5;ent_fire info_target addoutput "classname info_target_temp"

wait 10;give info_target
wait 10;give func_regenerate

wait 20;ent_fire info_target addoutput "targetname mytarget"
wait 20;ent_fire func_regenerate addoutput "StartDisabled 1"
wait 20;ent_fire func_regenerate addoutput "mins -100 -100 -100"
wait 20;ent_fire func_regenerate addoutput "maxs 100 100 100"
wait 30;ent_fire func_regenerate addoutput "solid 2"
wait 30;ent_fire func_regenerate addoutput "spawnflags 1"

wait 30;ent_fire info_target setparent player_me
wait 33;ent_fire func_regenerate setparent mytarget
wait 35;ent_fire func_regenerate enable



If you hate the resupply cabinet sound, use this one.
Here's the general script:
alias regen_on "impulse 101; wait 50; regen_on"
alias regen_off "alias regen_on impulse 101"

You'd have to re-execute the .cfg file if you want to turn the regen on again after turning it off.
Recommended by: http://steamcommunity.com/id/blacksmithgames
Paste this in soldier.cfg and demoman.cfg(or whatever class you do jumping with).
Heavy Exclusive Script
This heavy script lets you throw the sandvich with one click and eat the sandvich.
WARNING: If you do the "eat sandvich" while your minigun is revving down, you will taunt with the minigun.

SCRIPT:
//SANDVICH DROP AND EAT SCRIPT

//Quick Sandvich toss
alias "+sandvichtoss" ";slot2;wait 50;+attack2;wait 50;-attack2"
alias "-sandvichtoss" "-attack2"
bind "mouse4" "+sandvichtoss"


alias +sandvichtoss "slot2; +attack2
alias "-sandvich2" "voicemenu 0 1"
bind MOUSE4 +sandvich1
bind MOUSE3 +sandvich2
Medic Script
This medic scripts is an all purpose medic script. Although it does not include an autoheal feature, is is an all around good script.

Key
Function
R
Masks Uber (Silences "FOOLY CHAAAAGED" When "R" is pressed)
F
Fakes Uber (Says "FOOLY CHAAAAAAAAGED" to confuse enemy team)
E
Medic Radar (Shows all alive teammates to you)

SCRIPT:
//keybinds
alias "mask" "voicemenu 2 4; say_team "~#~ UBER READY! ~#~"
bind r mask

alias "fakeuber" "voicemenu 1 7; say_team "~#~ UBER FAKED ~#~"
bind f fakeuber

bind MOUSE2 "+attack2; uber"
alias uber "say_team ~#~Uber Popped~#~"

alias "autocall_default" "hud_medicautocallersthreshold "80""
alias "autocall_all" "hud_medicautocallersthreshold "150""
alias "+radar" "autocall_all"
alias "-radar" "autocall_default"
bind t "+radar"

alias "autocall_default" "hud_medicautocallersthreshold "80""
alias "autocall_all" "hud_medicautocallersthreshold "150""
alias "+radar" "autocall_all"
alias "-radar" "autocall_default"
bind e "+radar"

bind "n" "+inspect"

alias "primary" "slot1; r_drawviewmodel 0"
alias "secondary" "slot2; r_drawviewmodel 0"
alias "melee" "slot3; r_drawviewmodel 1"

bind "1" "primary"
bind "2" "secondary"
bind "3" "melee"

Engineer Script
This script lets you aut build/destroy your buildings. Mainly used with Mini Sentries, with the Frontier Justice, or in tight pinches.

Key
Function
mouse3
Sentry
f1
Dispenser
f2
Tele Entrance
f3
Tele Exit

SCRIPT:
alias sentry "destroy 2; build 2";
alias dispenser "destroy 0; build 0";
alias entrance "destroy 1; build 1";
alias exit "destroy 3; build 3";

bind MOUSE3 sentry;
bind F1 dispenser;
bind F2 entrance;
bind F3 exit;


SECONDARY SCRIPT: for those who want to use arrow keys instead of function keys.

Key
Function
mouse3
Sentry
Up Arrow
Dispenser
Left Arrow
Tele Entrance
Right Arrow
Tele Exit

alias sentry "destroy 2; build 2";
alias dispenser "destroy 0; build 0";
alias entrance "destroy 1; build 1";
alias exit "destroy 3; build 3";

bind MOUSE3 sentry;
bind UPARROW dispenser;
bind LEFTARROW entrance;
bind RIGHTARROW exit;


Conclusion
Thanks for reading through my first ever guide! I hope this helped you find a script that suits your needs. If there is a script you really like, but it was not included in this guide, put it in the comments below! I would also love to hear feedback and things I could do better in the future in the comments.


If you love this guide and want to see more DONATE HERE:
https://steamcommunity.com/tradeoffer/new/?partner=174532087&token=tvCIqp7F

70 Comments
ref Feb 7 @ 1:26pm 
years late, but isn't it better to crouch before jumping when crouch jumping? crouch before jump allows u to go ever so slightly higher, meaning u can jump onto the payload and other stuff like this
Endi Nov 9, 2023 @ 7:25am 
Pardon me but how does the heavy script work? Having a hard time understanding it.
Willow the Sinner May 20, 2023 @ 3:33pm 
Ay, uh. Is it possible to set JOY1 though 9 to other external keys, like MMO mouse keys for example?
of course i have a pink tip Jun 24, 2022 @ 5:06pm 
very /late but if you don't want configs to carry into other classes, make a .cfg called "reset.cfg" and put "exec reset" at the top of every custom .cfg
ciba  [author] May 19, 2019 @ 7:00pm 
put them into a class specific .cfg file (soldier.cfg or medic.cfg etc.) or an autoexec file (unless it says not to). https://youtu.be/xcRkpXmywAs
AD_Ry3 May 19, 2019 @ 9:22am 
how do you make them work into tf2?
qrosa Feb 23, 2018 @ 12:59pm 
@Cloud-Nein the wait command is disabled on most servers.
replace the first line with: alias +sandvichtoss "slot2; +attack2
and it will work. (you will need to hold mouse4 for half a second.)
Cloud-Nein Feb 23, 2018 @ 12:50pm 
Awesome guide. Can't get the Heavy sandvich script to work though. Anyone having any luck with it?
Baron Davis Nov 19, 2017 @ 3:27pm 
perfect guide, 10/10, 4 out of 4 stars (or is it 5 now, WHO DECIDES THESE THINGS????)
ZADNE Feb 2, 2017 @ 3:14pm 
Gearweel: Just made one for you:
bind "T" "incrementvar tf_medigun_autoheal 0 1 1"
Feel free to change T to any key you want...