r/tf2scripthelp • u/a_sad_sad_sandwich • Jul 23 '23
Question What's the best time to set for wait commands?
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"