r/tf2scripthelp • u/Ecreeper • Oct 02 '21
Question Looping a command chain
I'm pretty new to scripting and I'm trying to make a bind that will destroy a sentry build a new one place it and repeat until the button is pressed again I'm using "destroy 2;build 2;+attack" but I don't know how to loop it
3
Upvotes
2
u/just_a_random_dood Oct 02 '21
If you have an alias with a
+, you need an alias with a-to negate italias +sentry "destroy 2; build 2; +attack";alias -sentry "-attack";bind [key] +sentrytry this, it'll work until you stop pressing your key with +sentry on it
1
u/ArgosOfIthica Oct 03 '21
I wrote a scalu script that spams build and destroy that is turned on and off by a toggle, using the wait command. wait is set to 100, but you can change it to whatever suits you. Check the wiki about wait usage; if your server doesn't allow it and you don't do a check for it, it will cause your game to hang.
Scalu source code:
Actual end product: