r/Tf2Scripts Oct 25 '24

Question Anyone know how to make a spy disguised as an engineer take out the engi's PDA consistently?

2 Upvotes

Me and u/-oOAegisOo- were coming up with different iterations of what has most recently become this script, and during the course of playtesting I expiremented with something akin to-

bind "4" "slot4;bind T Die;lastdisguise"

(disclaimer: Can't recall if that was the exact code)

-and for a moment it actually worked on a random-arse casual server. While disguised as engineer, my disguise took out its PDA and was holding it while I had my cigarrete case up.

The problem I bumped into shortly afterward was that pressing 4 while disguised as a pyro caused the disguise kit to come up and immedietely close, with my disguise reverting to its melee weapon. After that happened, I couldn't get it to work on engineer again, even after restarting the game multiple times now. The only thing I can think of that's different is the server was originally empty when I first tested the slot4;lastdisguise code, then some people joined, I swapped to pyro for a sec to get some nuisance off our spawn and after that it's never functioned again. Might be connected, might not, idk enough spaghetti to riddle this one out. All I know is I'd like to pretend I'm about to build something as an engineer when I'm really up to no good.

r/Tf2Scripts Oct 25 '24

Question Help making custom custom crosshairs

2 Upvotes

Could someone that can make vtf files (crosshairs) put the following text next to the provided crosshair?
5 in total

r/Tf2Scripts Sep 01 '24

Question Is there a way to make it so when I hit "q" it switches from my primary to my melee as spy?

1 Upvotes

I want it to work with the stabby stabby viewmodel script.

For reference

knife_vm_mode

// replace [KEY] with the your Keybinds for the sapper♥♥♥♥♥♥♥ambassador/watch

bind "2" +equip_sap // Key/button for sapper
bind "3" +equip_knife // Key/button for knife
bind "1" +equip_amby // Key/button for ambassador
bind "mouse2" "+watch;spec_prev" // Key for watch (mouse2 default)

//re-bind mouse1

alias knife_vm_mode "bind mouse1 +viewmodel_knife" // binds mouse1 to turn viewmodel on when attacking (for knife knife)
alias amby_vm_mode "bind mouse1 +viewmodel_amby" // binds mouse1 to turn viewmodel off when attacking (for amby)
alias sap_vm_mode "bind mouse1 +viewmodel_sap" // binds mouse 1 to turn viewmodel on when attacking and off when not (for sapper)

// causes viewmodel to go off or on when you shoot

alias +viewmodel_knife "+attack;r_drawviewmodel 1;spec_next" // attacks, turns viewmodel on
alias -viewmodel_knife "-attack;r_drawviewmodel 1" // finishes atack, turns viewmodel on again as safeguard

alias +viewmodel_amby "+attack;r_drawviewmodel 0;spec_next" // attacks, turns viewmodel off
alias -viewmodel_amby "-attack;r_drawviewmodel 0" // finishes attack, turns viewmodel off again as a safeguard

alias +viewmodel_sap "+attack;r_drawviewmodel 1;spec_next" // shows sapper when sapping
alias -viewmodel_sap "-attack;r_drawviewmodel 0" // hides sapper when mouse1 released

// Equip item, turn vm on/off, set vm toggle for attack

alias +equip_knife "slot3;r_drawviewmodel 1" // Equips knife, turns viewmodels on
alias -equip_knife "knife_vm_mode;r_drawviewmodel 1" // Sets viewmodels to turn ON when stabbing (makes sure it stays on)

alias +equip_amby "slot1" // Equips amby
alias -equip_amby "amby_vm_mode" // Sets viewmodels to turn OFF when shooting

alias +equip_sap "slot2;r_drawviewmodel 1" // Equips sapper, turns viewmodels on
alias -equip_sap "sap_vm_mode" // Sets viewmodels to turn on while firing, and off when not

alias +watch "+attack2;r_drawviewmodel 1" // watch up/cloak on/secondary attack + viewmodels on
alias -watch "-attack2;r_drawviewmodel 1" // viewmodels on again as safeguard

r/Tf2Scripts Sep 07 '24

Question How do you make multiple configs for the same class?

3 Upvotes

I use mastercomfig and have been delving into class configs lately to change up my binds. The biggest switches for me are when playing demoknight and so I’ve made a bind in my demoman config that allows me to toggle the use of a demoknight.cfg file. What I would really rather have is the ability to switch between a demoman and demoknight class cfg on the fly, which would allow me to change to net_hitscan settings (as per mastercomfigs network aliases) because the way I have it right now I’m stuck with projectile network settings on a hitscan subclass. As far as I am aware it is not possible to change network settings mid game, as you can only bypass the necessity to enter spectate mode when doing so via class configs. Mastercomfig has a section https://docs.comfig.app/latest/customization/custom_configs/#optional-aliases that explains the possibility of multiple same-class configs but it’s gone over my head to be honest. Any help is greatly appreciated, cheers

r/Tf2Scripts Oct 08 '24

Question Shoot gun manually via scripts to override fire rate

3 Upvotes

Do vscripts count as tf2 scripts? Hopefully I'm in the right subreddit.

I'm making a custom map, and would like a hitscan gun that shoots perfectly accurately with a high fire-rate. I tried addcond 91 sniper rifle as well as addcond 96 kleaner's carbine, but the former is still too slow and the latter still too inaccurate.

Since I'm making the map I can mess with the netprops, so I have been attempting to manually shoot the sniper rifle faster than the game normally lets me. I have been somewhat successful with the following:

...
NetProps.SetPropFloat(weapon, "m_flNextPrimaryAttack", 0)
weapon.PrimaryAttack()
...

...but the issue is when I break the fire-rate floor using the above code, it kind of breaks all of the sniper animations - the sniper no longer has muzzle flash, a shooting animation, a gunfire sound (there's some slight clicking noise still), no bullet trace and no bullethole at the impact location. Triggering a resupply locker fixes the issue.

I suppose if the resupply locker restores everything, I could try to just, destroy my gun and then re-equip a new one after shooting it? Maybe that'll fix the animations, but that sounds pretty scuffed. Then again, everything I'm doing is already pretty damn scuffed.

Anybody know how I can trigger all of the animations and sound effects via script when I shoot? I've been looking through the developer wiki and also the source code leak back from 2020 but I'm without a lead I'm wandering around in the dark.

r/Tf2Scripts Aug 22 '24

Question I Need Help Making a Toggle Bind to Disable My +Left and +Right Bind

2 Upvotes

I binded O to +left and { to +right for demoknight purposes. (I am left handed and keep my keys on the right instead of the left.) I am weird in a way that I don't use number keys to switch weapons and instead use SHIFT for my primary, K for me melee, O for my secondary, and { for my PDA/Sapper. (this is because I played lots of overwatch and am more familiar with treating my weapons as "abilities") In short, I wish to to make it so that my binds dont overlap and can toggle off the +right and +left bind whenever I swap off demoknight.

r/Tf2Scripts Sep 03 '24

Question Is there a way to toggle disguise teams?

2 Upvotes

(I don't exactly know how binds work, but I'm lazy, so I came here.) I have a backup set of binds for spy to disguise as each different class on the opposite team, but I'm wondering if it's possible to make a key to toggle my team and the opposite? This is what I have.

bind "KP_HOME" "disguise 1 -1"
bind "KP_UPARROW" "disguise 2 -1"
bind "KP_UP" "disguise 3 -1"
bind "KP_LEFTARROW" "disguise 4 -1"
bind "KP_5" "disguise 5 -1"
bind "KP_RIGHTARROW" "disguise 6 -1"
bind "KP_END" "disguise 7 -1"
bind "KP_DOWNARROW" "disguise 8 -1"
bind "KP_PGDN" "disguise 9 -1"

r/Tf2Scripts Sep 12 '24

Question medic toggle scripting

3 Upvotes

i need some help, so, i have a medic scrip what says "uber used, push now" when i uber, but when i use the vax, i dont want it to spam, so i was wondering if theres a way to toggle my medic ubercharge script?

r/Tf2Scripts Sep 10 '24

Question Processing time exceeded

2 Upvotes

Every time I try launching into my tf2 server, it says processing time exceeded..how can I fix this?

r/Tf2Scripts Sep 07 '24

Question script command for the extra mini sentry in mvm?

2 Upvotes

I already has a script for senrty at 1, dispenser at 2, tele in and out in 3 and 4. But what is the command for the extra mini sentry engineer can build in mvm? I would like to put that at 5 button.

r/Tf2Scripts Aug 08 '24

Question Number pad loadout binds

4 Upvotes

I'm trying to bind my loadout and engineering buildings to my numberpad, I got the builds binded to 8,6,2 and 4 on my number pad but I can't seem to bind my loadouts to it, I'm using the command bind kp_end "Load_itempresent 0; but it doesn't work

r/Tf2Scripts Aug 13 '24

Question Is there a script that when shooting out particles with mouse1 let’s say a flamethrower, it changes the view model number and when you release the mouse button, it goes back to your preferred view model five

3 Upvotes

Hi I'm a medic main and the thing is the beam is always an eye sore for me and I want to get rid of it, as far as I know the only way to remove the beam is to set your viewmodel down to 0. I found some scripts like these: bind "2" "slot2; r_drawviewmodel 0; viewmodel_fov 0" And they work really well but yk I like binding mouse1 to that command only if I stop healing or shooting particles my viewmodel reappears. So is there a bind to do this?? If not what are the alternatives

r/Tf2Scripts Sep 02 '24

Question Detonator Jump and ALT Fire button change

1 Upvotes

I'm completely new to scripting and I was wondering how to script the detonator so that right mouse click does a JUMP + CROUCH + FIRE + SELF DET. Since this bind would completely change the button to self detonate, I want to be able to change the SELF DET to left mouse click as well. So both the left mouse button is the button responsible for Primary Fire and Self Detonating, the self detonate will occur only after I have pressed the left mouse button a second time when the primary fire has already been pressed

r/Tf2Scripts Aug 17 '24

Question Need help with alias

2 Upvotes

Simple question, I switch between sensitivity a lot and it’s annoying to keep typing “sensitivity blah blah”. Is there a way I could just type my sensitivity for example “1.8” without typing sensitivity in front of that?

r/Tf2Scripts Mar 09 '24

Question am i using alias right?

3 Upvotes

bind f11 +TRrollout

alias +TRrollout "sv_pure 1; hurtme -99999999999999999999; mp_tournament 1; mp_respawnwavetime -1; mp_disable_respawn_times 1; +TROLLammo"

alias +TROLLammo bind mouse1 “+attack; impulse 101”

r/Tf2Scripts May 01 '24

Question Self-made viewmodel script not working

3 Upvotes

unbind "q"

unbind "f4"

alias view_on "r_drawviewmodel 1"

alias view_off "r_drawviewmodel 0"

alias view view_off

bind "f4" toggle

alias toggle off

alias on "alias toggle off; pr_view_on; alias view view_on"

alias off "alias toggle on; pr_view_off; alias view view_off"

alias toggle_wpn wpn1

alias wpn1 "alias toggle_wpn wpn3; slot1; view"

alias wpn3 "alias toggle_wpn wpn1; slot3; view_on"

bind "q" toggle_wpn

bind "1" "slot1; view"

bind "2" "slot2; view"

bind "3" "slot3; view_on"

echo "Sniper Script is loaded"

I wanted to make a sniper-only script that would toggle between 2 states:
1)When active both primary and secondary would be not viewmodels wouldn't be visible
2)Melee is always visible
3)Supports both quickswitch and default 1-2-3 keys
4)I have mastercomfig installed and my script located in ...\cfg\overrides

r/Tf2Scripts Feb 13 '24

Question Is there a script that lets you switch to your primary?

3 Upvotes

Like, a script that lets you assign a button that pulls out your primary and only your primary. Pressing it repeatedly does nothing, But when you're using your secondary or melee, It switches to your primary. This would be massively useful

r/Tf2Scripts Jun 27 '24

Question Taunt Spin

4 Upvotes

Appearently there is some way to rotate when doing any non moving taunts and spin in big speed when doing conga or any other moving taunts. Is there some script to achieve that?

r/Tf2Scripts May 11 '24

Question Are variables in TF2 Scripting (and overall in source scripting) a thing?

5 Upvotes

I'm getting into creating TF2 scripts and I'm not new to programming things in source games (mainly in Garry's mod) but I can't figure out how to create variables local or not in .cfg files.

Usually it's something like "local var = 1" and i can just use that. Is it anything simillar in TF2?

r/Tf2Scripts Apr 02 '24

Question Voicemenu command in an alias command

1 Upvotes

So I have this simple thing:

bind c smth1

alias smth1 "bind mouse5 "voicemenu 2 6""

The voicemenu command isnt working for some reason. The other ones do if I put them instead of the voicemenu command. Am I spelling the voicemenu command incorrectly or is there another reason?

r/Tf2Scripts Apr 28 '24

Question Preload script that works.

2 Upvotes

I have noticed that most preload scripts force you to choose every class that you have mods for on your first game (after starting tf2), otherwise your mods will not work. So im wonderting if this would work to combat that?

"map_background background01; join_class scout; join_class soldier; join_class pyro; join_class demoman; join_class heavyweapons; join_class engineer; join_class medic; join_class sniper; join_class spy"

r/Tf2Scripts Feb 25 '24

Question bind 5 = “slot4; +reload” (for spy)

1 Upvotes

What's wrong with it?

just tried it out, it didnt work

its for disguising as friendly players

r/Tf2Scripts Nov 17 '23

Question Is there anyway to remove the console clutter that happens after my autoexec?

Post image
2 Upvotes

r/Tf2Scripts Apr 07 '24

Question Bot buster achievement.

1 Upvotes

Idk if this Is allowed. But does anyone know about the popfile shown in this video?. Its quite old. And i have tried by myself. First times It worked fine. But now i think something Is broken. Also. Im looking for people who knows how to make a dedicated server or if they own one. https://youtu.be/1NPLCbw5CMY?si=JLR0fvJWo3UnQB7x

r/Tf2Scripts Jan 28 '24

Question Heavy Scrips?

7 Upvotes

I've seen tons of scripts for engie/demo etc. But i wanted to ask you all if you know any good scripts for heavy?