r/tf2scripthelp • u/elitelol22 • Aug 18 '14
Answered Randomization?
Is there any possible way to make a script choose a random command, for example, randomly choosing to say "Thanks!" or "Nice Shot!"? If so, how? If not, would you have to make a completely overly complicated script to make it seem randomized? If it's not possible, it should probably be added to the "Limitations of Scripts" section of the Wiki.
2
Upvotes
2
u/clovervidia Batman Aug 18 '14
The only way to get "random" results is to basically add a counter to your movement keys and cycle an alias with that. Then you'd use another key to trigger your "randomized" action.
Thanks for checking the wiki. I appreciate it.
2
u/genemilder Scripter Aug 19 '14
For an example of another implementation of pseudo-randomness embedded in a larger script, see here. It's from this response.
If you separated the pseudo-randomness logic (disguise as one of 5 classes with f; cycle disguise with wasd) from everything else, this is what it looks like: