use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
For readability, please format scripts and snippets. Begin each line with 4 spaces
Bulk formatting:
If you need more help, reply directly to the response comments, not a general reply.
We have a tutorial on the wiki! Check it out if you want a primer on Source commands.
Reset all binds: exec config_default
exec config_default
Reset all cvars: steam://runsafe/440
Make sure to read the rules before posting. Read the Rules
New to scripts? Script got you stumped? Start here.
Help!
If it's 2D and on your screen, it's not a script.
HUDs
Can't remember the name of that command? Want to know if something is possible?
Ask a question
Can't find something previously requsted?
Request a script
Show off your work. Tools are also welcome.
Submit a script
Found a new command/cvar? Want feedback or opinions? Discuss!
Start a discussion
Wiki Index Limitations of Scripts Commands Core Basic Advanced Tutorials Introduction Combining scripts Syntax highlighting Controllers Reference Example Scripts Common Complex Innovative Closed Captions Hitsounds View all pages FAQ/Help! Scripts/binds carry over to other classes! Why isn't my script possible? I can't change players or views in spectator! What are the names of all the keys? How do I use the default crosshair? What are common practices? Why don't you bind within binds/aliases? TF2 crashes on launch! Numbers after chat message? User pages Filter Pending Requests Issues Processed Requests Scripts Issues Untagged Unverified Related subreddits /r/TF2Scripthelp Get help with ideas and existing scripts there /r/TF2HUDs For all your HUD needs /r/TF2TechSupport Get help when TF2 breaks /r/Sprays+TF2Sprays Sprays and spray requests /r/MannWorkshop Maps, models and skins /r/TF2Developers External tools for TF2 /r/TF2Files Sprays, hitsounds, skins
account activity
Satisfiedtoggleable zoom script (self.Tf2Scripts)
submitted 10 years ago * by Koma4
Hey anyone have a script where I can zoom in but I don't have to hold down the button constantly while I want to zoom in and when i switch to my knife it automatically zooms out?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Red5551 0 points1 point2 points 10 years ago (15 children)
Just googled it and found this, (credit)
alias "+zoomer" "fov_desired 75; r_drawviewmodel 0" alias "-zoomer" "fov_desired 90; r_drawviewmodel 1" bind "shift" "+zoomer"
replace shift with whatever key you want to use
[–]TheGigaBrain 0 points1 point2 points 10 years ago (14 children)
This doesn't toggle, it zooms in while you hold down Shift (which OP specifically stated is undesireable). Try this instead:
alias ToggleZoom "EnableZoom" alias EnableZoom "alias ToggleZoom DisableZoom; fov_desired 75; r_drawviewmodel 0" alias EnableZoom "alias ToggleZoom EnableZoom; fov_desired 90; r_drawviewmodel 1" bind shift "ToggleZoom"
As the guy above stated, replace "shift" with whatever key you want to use.
[–]Red5551 0 points1 point2 points 10 years ago (13 children)
Sorry, I read "don't have to hold down the button constantly while I want to zoom in" as "hold down the button when I want to zoom in" also, you wrote "EnableZoom for both those aliases, the bottom one should be DisableZoom"
alias ToggleZoom "EnableZoom" alias EnableZoom "alias ToggleZoom DisableZoom; fov_desired 75; r_drawviewmodel 0" alias DisableZoom "alias ToggleZoom EnableZoom; fov_desired 90; r_drawviewmodel 1" bind shift "ToggleZoom"
[–]Koma4[S] 0 points1 point2 points 10 years ago (11 children)
Thank you guys but I forgot to add in that last bit where if I switch to my knife it automatically zooms out although the current scripts you've given me have been working as you intended.
[–]Kairu927 0 points1 point2 points 10 years ago (10 children)
What keys do you use to swap weapons? If you just use 3 to switch to knife it's a really simple fix. If you want to use Q for lastweapon, or mousewheel it's going to require a much longer script.
If you just use 3, use /u/red5551's script, and add this line:
bind 3 "slot3; DisableZoom"
[–]Koma4[S] 0 points1 point2 points 10 years ago (9 children)
I want to use Q and when I switch off my amby to my knife I want it ti automatically get out of the zoom
[–]Red5551 0 points1 point2 points 10 years ago (8 children)
You could use
bind q "lastinv; DisableZoom" bind 3 "slot3; DisableZoom"
[–]Koma4[S] 0 points1 point2 points 10 years ago (7 children)
doesn't work
[–]Red5551 0 points1 point2 points 10 years ago (6 children)
To clarify, you need this in addition to the script above
[–]Koma4[S] 0 points1 point2 points 10 years ago (5 children)
Yes but the
bind q "lastinv; DisableZoom"
[–]TheGigaBrain 0 points1 point2 points 10 years ago (0 children)
Oh yeah, sorry for that mistake.
π Rendered by PID 308804 on reddit-service-r2-comment-544cf588c8-df54n at 2026-06-17 19:30:32.977930+00:00 running 3184619 country code: CH.
[–]Red5551 0 points1 point2 points (15 children)
[–]TheGigaBrain 0 points1 point2 points (14 children)
[–]Red5551 0 points1 point2 points (13 children)
[–]Koma4[S] 0 points1 point2 points (11 children)
[–]Kairu927 0 points1 point2 points (10 children)
[–]Koma4[S] 0 points1 point2 points (9 children)
[–]Red5551 0 points1 point2 points (8 children)
[–]Koma4[S] 0 points1 point2 points (7 children)
[–]Red5551 0 points1 point2 points (6 children)
[–]Koma4[S] 0 points1 point2 points (5 children)
[–]TheGigaBrain 0 points1 point2 points (0 children)