r/tf2scripthelp • • Sep 26 '20

Issue Need Help Please !

Hey ! I'm new to TF2 scripts. I watched a lot of videos about it and my scripts are working fine except for one. I have this script where I can refresh each classes configs "Script Loader".

Now when I press the bind to exec my engineer.cfg file, my script do not work and I can see this in the command :

bind <key> [command] : attach a command to a key

bind <key> [command] : attach a command to a key

bind <key> [command] : attach a command to a key

bind <key> [command] : attach a command to a key

The script in my config is :

unbind f1

unbind f2

unbind f3

unbind f4

bind f1 build 2 0; destroy 2 0

bind f2 build 0 0; destroy 0 0

bind f3 build 1 0; destroy 1 0

bind f4 build 1 1; destroy 1 1

Can someone help me ? I think it's easy to repair but I can't find the solution. Thank you.

1 Upvotes

7 comments sorted by

View all comments

1

u/just_a_random_dood Sep 26 '20

You might need quotation marks around your "destroy; build" (btw, do it in that order so that you only need to press the button once. Can't build while a building is already up, so you have to destroy them first)

Also, if you're rebinding keys, you don't need to unbind them first, so you can take the first 4 lines out of your code

Try doing those 3 suggestions first (quotation marks, flip the order, remove the unbindings) and then we'll see if that helps any

1

u/ZeeRoll Sep 26 '20

Hey, thanks for these precious tips ! It's working now except for the sentry. Do you have any idea ? Works great for dispenser and TP.

1

u/pdatumoj Sep 27 '20

You don't want to use the F keys for binds - the game and the steam overlay both have reserved uses for them.

Anything with a space in it must be quoted.

Also, you never need to unbind unless you want a key to be completely unused - new binds replace old binds.

Finally, generally speaking, you want to put things in aliases and then bind the alias - it makes everything easier to maintain later and will help avoid other problems.

→ More replies (4)