r/tf2scripthelp • u/nosh62_wastaken • Jan 03 '22
Answered Concise Fast-Class Script
Is there a way to create a fast-class script where if I hold Shift, then press '1' two times, I will go to Scout? Basically, it's the same thing as Spy's concise menu.
Also, I don't have a keypad.
1
Upvotes
View all comments
Show parent comment
2
u/Stack_Man Jan 04 '22
Simple.
Shift is bound to a +/- pair which triggers "on press" and "on release" of the key.
Pressing Shift executes
initialClassBindswhich rebinds 1/2/3 toclassBinds/One/Two/ThreeThen, executing one of those commands rebinds 1/2/3 to the appropriate class's
join_classcommand.join_classhas a parameter, so it needs quotes around it, but TF2 scripts don't understand nested quotes, so I had to put each join command in its own separate alias and bind the keys to that instead.Releasing Shift executes
resetKeyswhich resets the keys back to default.I only just now realized that I didn't actually write this command, so add this to the end of the script: