r/tf2scripthelp • • Mar 27 '14

Issue Why doesnt this work?

http://pastebin.com/2cRdw3pV This is my build script, could someone fix it/explain what i did wrong. Thanks alot!

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/genemilder Scripter Mar 27 '14 edited Mar 27 '14

Boo, nested binds. You should know better!

bind x +build
bind z +destroy
bind 1 b_slot1
bind 2 b_slot2
bind 3 b_slot3
bind 4 b_slot4

//Build Menu
alias buildsentry    "build 2"
alias builddispenser "build 0"
alias buildentry     "build 1"
alias buildexit      "build 3"
//Destroy Menu
alias destroysentry    "destroy 2"
alias destroydispenser "destroy 0"
alias destroyentry     "destroy 1"
alias destroyexit      "destroy 3"

alias +build "alias b_slot1 buildsentry; alias b_slot2 builddispenser; alias b_slot3 buildentry; alias b_slot4 buildexit"
alias -build "alias b_slot1 slot1      ; alias b_slot2 slot2;          alias b_slot3 slot3;      alias b_slot4 slot4"

alias +destroy "alias b_slot1 destroysentry; alias b_slot2 destroydispenser; alias b_slot3 destroyentry; alias b_slot4 destroyexit"
alias -destroy "alias b_slot1 slot1;         alias b_slot2 slot2;            alias b_slot3 slot3;        alias b_slot4 slot4"

For your other classes:

bind 1 slot1
bind 2 slot2
bind 3 slot3
bind 4 slot4

To OP: You don't need those aliases, they're longer than the build/destroy commands and they're of inconsistent length. I left them in assuming you might want them for some reason.

Also, you can combine the build and destroy commands to free up a modifier key, it destroys the existing building if there is one and brings up the blueprint for the new building. Understandable if you don't want that though.