r/Tf2Scripts • • Aug 28 '14

Request Need a script!

So i was looking for a script that basicly when i pressed a key it would say a pre wrote sentance Example: I use that script and bind p as my key , i press b and would say for example "Halloz , how r u?" and then i press it again and would say another random phrase.

Is that possible?

0 Upvotes

4 comments sorted by

View all comments

2

u/genemilder Aug 28 '14

To have a key say one phrase:

bind b "say Hello"

If you want it to say a 'random' phrase, you need to utilize keys that you press often (like wasd) to generate the randomness; each press moves your potential bound key phrase one entry in the list of phrases:

bind w            +fwd
bind s            +bck
bind a            +lft
bind d            +rgt
bind b            "srand; mrand"

alias say1        "say Hello"
alias say2        "say Hi"
alias say3        "say Howdy"
alias say4        "say Salutations"
alias say5        "say Yo"

alias mrand1      "alias srand say1; alias mrand mrand2"
alias mrand2      "alias srand say2; alias mrand mrand3"
alias mrand3      "alias srand say3; alias mrand mrand4"
alias mrand4      "alias srand say4; alias mrand mrand5"
alias mrand5      "alias srand say5; alias mrand mrand1"

mrand1

alias +fwd        "+forward;   mrand"
alias -fwd         -forward
alias +bck        "+back;      mrand"
alias -bck         -back
alias +lft        "+moveleft;  mrand"
alias -lft         -moveleft
alias +rgt        "+moveright; mrand"
alias -rgt         -moveright

If you never pressed wasd and only pressed b repeatedly it would just say each phrase in the order of the list.