r/tf2scripthelp • • Jul 23 '23

Question How do I make a console command repeat every second?

2 Upvotes

I can't really find an answer and I'm pretty new to this. I'm trying to repeat a console command (impulse 101) every tick. How can I do this? Reminder: I am very new so please type the entire script out. Also, am I find just putting it in .cfg or should I place it in autoexec?


r/tf2scripthelp • • Jul 23 '23

Question What's the best time to set for wait commands?

2 Upvotes

I'm currently trying to make a quickswap script for medic. I press MOUSE5, I automatically switch over to my crossbow, fire off a shot, and then immediately switch back to the medigun. The switch-to and back works perfectly, however, there's been an inconsistency as to whether or not I shoot the crossbow at all. Sometimes, the script works as intended and other times, it just switches to the crossbow and back without shooting.

I'm not particularly sure, but I think it has to do with my FPS. On tr_walkway, for example, I get about 500+ frames in the spawn room, and the script doesn't work. When my fps dips to around the 300 fps range though, then the script works as intended.

Is there a "best value" to set for wait commands or is it purely dependent on my FPS?

Here's the script for reference:

//Crossbow, shoot, medigun

alias csm "slot1; wait 115; +attack; wait 115; slot2; -attack"

bind "MOUSE5" "csm"


r/tf2scripthelp • • Jun 18 '23

Question My engineer build and eureka binds wont work

2 Upvotes

the title says it all, i have all my scripts in autoexec.cfg and when i moved my engi scripts in engineer.cfg it still doesnt work
this are my binds maybe theres something wrong with them
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 "5" sentry;
bind "6" dispenser;
bind "t" entrance;
bind "y" exit;
bind b +teleport
alias +teleport slot3
alias -teleport Teleport_To_Spawn
alias Teleport_To_Spawn "eureka_teleport"
alias Teleport_To_Exit "eureka_teleport 1"
bind shift +toggleTeleport
alias +toggleTeleport "alias -teleport Teleport_To_Exit"
alias -toggleTeleport "alias -teleport Teleport_To_Spawn"


r/tf2scripthelp • • Jun 01 '23

Question Is there any way for me to have a condition for having been healed by a medic?

2 Upvotes

I'm 90% sure there's no easy way to just detect if you've been healed, the closest I've seen in the list of commands that I'm unsure about is "hud_medichealtargetmarker," I'm just confused whether this refers to the hud element that shows a medic who they're healing, or the hud element that tells a player who they're healer is. Even though I assume its the former rather than the latter, I planned to do some work-around that tried to detect if the hud element said you were currently being healed, assuming that it's the latter.

AND ALL THIS, is just because I'm trying to make a bind that will call for medic, and then if I was healed, pressing it again instead says thanks. (Because I have a tiny little brain and can't think to which button would be call for medic and which is thanks. I want be nice and say thank you after being healed; but because my current problem, I settle for literally just shaking my head yes at the medic.)


r/tf2scripthelp • • May 26 '23

Question Is there any way to print to console without the trailing newline?

2 Upvotes

The echo command usually prints a newline after the text. However, sometimes it does not do this. Is there any pattern to this behavior, or a separate command to print without the newline? I have tried several workarounds, with stuff like debug dump commands and con_filter, but have not found a way. Is this possible to do, or would some sourcemod plugin be needed?


r/tf2scripthelp • • Mar 11 '23

Issue cfg file not working

2 Upvotes

I made an engineer.cfg file for eureka effect/quickbuild binds, but it doesn't work in game. In launch options I added the exec command, and I put it in tf/cfg. I don't know what I did wrong, but my discord username is paowoww#6748 if anyone wants to discuss it further.


r/tf2scripthelp • • Feb 26 '23

Answered Trying to use alias to use multiple chatbinds on the same key, need help.

2 Upvotes

I'm trying to make it so that KP_5 posts an advertisement and then alt+KP_5 posts more details about it, but every time I fix and run the code, console spits out "Bind {key} [command]"

heres the raws:
bind KP_5 say i build computers and do commissions if you're interested hmu

alias +alternate_bind "bind KP_5 say I'll give you 1 key for every person you refer to me who buys a computer."

alias -alternate_bind "unbind KP_5; bind KP_5 say i build computers and do commissions if you're interested hmu"

bind ALT "+alternate_bind"


r/tf2scripthelp • • Feb 22 '23

Question Eureka bind with MWHEEL + Shift

2 Upvotes

I want make a bind where i press MWHEELUP + Shift to go at spawn and MWHEELDOWN + Shift to exit, is that possible?


r/tf2scripthelp • • Nov 12 '22

Question Help achieving better VR menus

2 Upvotes

I need to run this command

Vr_moveaim_mode 1

on the menu screens, including the main one if possible. Whats the best way to achieve that?


r/tf2scripthelp • • Oct 27 '22

Question [Request] General Medic Radar

2 Upvotes

I bind my medic radar to mouse3 but I keep forgetting to press it thus always ended up being left alone at the front line. Anyways, I was thinking if there's a way to bind medic radar to movement keys such as wasd and weapon keys like mouse1 and mouse2.


r/tf2scripthelp • • Oct 22 '22

Question Does there exist a command to remove certain weapons from mousewheel selection?

2 Upvotes

I've got keybinds that bypass the need to ever pull out Engineer's PDAs or Spy's disguise kit, so if I could, say, go straight from wrench to shotgun with a single mouse scroll that'd be quite helpful.


r/tf2scripthelp • • Sep 11 '22

Issue How to stop mat_mipmaptextures from being set back to 1.

2 Upvotes

It's just like it sounds I don't know how to keep mat_mipmaptextures at 0 it is always getting sent back to 1. is there anything I can do?


r/tf2scripthelp • • Sep 11 '22

Issue How do I remove an alias command in TF2?

2 Upvotes

I wanted to make an alias addcond command in TF2. But now that I did that I can't use any addconds. It was addcond 1000 so now when I type any addconds it just says "Unknown command:1000" so please help me!


r/tf2scripthelp • • Aug 18 '22

Question trying to make heavy say something when he fires his primary

2 Upvotes

i can only get it to either say something when slot 1 is selected or it will say it but keep shooting without mouse imput. idk what to do.

i already have class cfgs


r/tf2scripthelp • • Jun 25 '22

Question TF2 dips to 20fps with mastercomfig low

2 Upvotes

I use a laptop with a 2.3 GHZ CPU and 4GB of ram, It runs god like at times and I'm thinking it's about my mods. I use a version of flawhud edited by tf2 hud editor, flat textures, kill icons and less distracting explosions, last time I remember I had high fps was yesterday with rayshud. It might be the hud or not, can someone help?


r/tf2scripthelp • • Apr 07 '22

Question How to make a script bind Reload and Inspect to one button?

2 Upvotes

Hi, I’m trying to create a script that allows me to press a button normally to reload a weapon (Vaccinator and Eureka Effect), but when I hold shift I will inspect it. I’ve been able to do this with voice commands, but when I try to set up reload/inspect, it appears to indefinitely “hold down” the key.

I've done some research and found I need to do something with +/- but I can't figure out how to get -reload to function. Is it possible for this to work?

If anyone can please help me with this, that would be greatly appreciated!

//Here's what my script looks like

bind MOUSE4 weapon
alias weapon reload_weapon
alias +reload_weapon "+reload"
alias -reload_weapon "-reload"
alias +inspect_weapon "+inspect"
alias -inspect_weapon "-inspect"

bind shift +toggleState
alias +toggleState "alias weapon inspect_weapon"
alias -toggleState "alias weapon reload_weapon"

r/tf2scripthelp • • Mar 29 '22

Question Simple question, probably already answered, can't be bothered to look.

2 Upvotes

How do I make Q switch between just my knife and revolver, while removing the viewmodel for the revolver, but keeping it for the knife?

I know "slot3;slot1" is how to do the first bit, but I can't seem to tie the viewmodel removal to it. Whatever I try, pressing it removes the viewmodel upon switching, but never brings it back. It seems like it ought to be possible, and simple, but I can't figure it out.


r/tf2scripthelp • • Mar 28 '22

Issue impulse 101 not working

2 Upvotes

ive been trying to train my rocket jumping skills by using "bind mouse1 +attack;impulse 101" and it says 101 is not a valid command. help!


r/tf2scripthelp • • Mar 21 '22

Resolved Regarding my medic script/config file edit

2 Upvotes

So I created these configs for medic:

// Auto call changer

alias "autocall_initial" "hud_medicautocallersthreshold "60"" // Initial autocall percentage

alias "autocall_temp" "hud_medicautocallersthreshold "150"" // Autocall percentage when getting out blutsauger/syringe

// Medigun/kritzkrieg

alias "+heal" "slot2;+attack;bind "mouse4" "+saw";autocall_initial"

alias "-heal" "-attack"

// Syringe gun/blutsauger

alias "+needles" "slot1;+attack;bind "mouse4" "+saw";autocall_temp"

alias "-needles" "-attack"

// Bonesaw/ubersaw

alias "+saw" "slot3;+attack;autocall_temp"

alias "-saw" "-attack;lastinv"

alias "+sawnoswitch" "slot3;+attack;autocall_temp"

alias "-sawnoswitch" "-attack"

// Uber and notification

alias "+uber" "slot2;dropitem;+attack2;maskuber_alt;autocall_initial"

alias "-uber" "-attack2"

// Shift mask

alias "+shiftmask" "bind "mouse4" "+sawnoswitch";bind "mouse2" "+uber"

alias "-shiftmask" "bind "mouse2" "-uber";bind "mouse2" "+heal" // No rebind for mouse3 because we don't want it to return to default behaviour before switching to new slot

//HELP

alias "help" "voicemenu 2 0"

//

bind "mouse2" "+heal"

bind "mouse1" "+needles"

bind "mouse4" "+saw"

bind "mouse3" "+radar"

bind "shift" "+shiftmask

____________________________________________________________________

The problem here occurs when I press right click + shift + right click in quick session in that exact order. This causes the script to continuously spam the "uber button" (slot2;+attack2). I tried adding -attack2 for -uber but it did nothing and the problem still happens. Any help is appreciated, thank you for reading this.


r/tf2scripthelp • • Mar 21 '22

Question What will happen if i overwrite engineer. cfg file in tf/cfg folder?

2 Upvotes

Hello im new to this script thing I saw a reddit post that if you put a new engineer.cfg file and overwrite the old one it will probably mess with important game file Is this true?


r/tf2scripthelp • • Mar 17 '22

Question User Info Values

2 Upvotes

How do i read user info values?

also how do i make a if statemant. with setinfo?


r/tf2scripthelp • • Jan 30 '22

Question Should I use cl_interp_ratio 1 or 2?

2 Upvotes

I've heard that using 2 is generally advised to avoid packet loss, but my internet is pretty decent, and I wanted to know how if you should use 1 if you have good internet. Thanks.


r/tf2scripthelp • • Dec 28 '21

Issue Broesel crosshair switcher not working

2 Upvotes

I usually run a lime green cross but when I heard about this script it blew my mind, I downloaded it and set it up for every class, when I launched my game to test it didn't work, I still had the lime green cross I use, I tried placing it in a folder I created on the custom folder, the cfg folder and on the same folder my autoexec.cfg is, nothing worked. I use mastercomfig's low preset. If the two people using this subreddit read this post I would be grateful with any kind of help.


r/tf2scripthelp • • Nov 20 '21

Answered Confused with scripting

2 Upvotes

I dont really know where to put my scripts, yeah i was originally putting it in my scripts in the custom folder. But it ends up breaking my console and loading into a game. The scripts I use are medic radar, crouch jump, null move, a giant script for all nine classes on gambanana and a quick class switcher. For some reason only my null move works, and I put it in autoexec. I know the basics of scripting and put the others in their own class. Also, I dont have mastercomfig installed. The classes scripts always begin with "exec autoexec" and "exec reset" Please help me, thanks in advance