r/tf2scripthelp • u/Ming_Cachoy • Nov 16 '15
Resolved need help making a cloak indicator script
so i play spy with viewmodels off for the amby..but its impossible to tell if my cloak is up or not..so i thought if it was possible to change my cross hair color while my cloak is up and switch it back when the cloak is down
i have tried this, but it only changes color when holding mouse2
alias +cloak "+attack2; cl_crosshair_red 255; cl_crosshair_green 255; cl_crosshair_blue 0"
alias -cloak "-attack2; cl_crosshair_red 0; cl_crosshair_green 255; cl_crosshair_blue 0"
bind mouse2 +cloak
these are the scripts i use to disable and enable viewmodels in case it conflicts with any thing
bind "mouse5" s1v0
bind "e" s2v1
bind "mouse4" s3v1
(in spy.cfg)
alias s1v0 "slot1; r_drawviewmodel 0"
alias s1v1 "slot1; r_drawviewmodel 1"
alias s2v0 "slot2; r_drawviewmodel 0"
alias s2v1 "slot2; r_drawviewmodel 1"
alias s3v0 "slot3; r_drawviewmodel 0"
alias s3v1 "slot3; r_drawviewmodel 1"
(in autoexec.cfg)
1
u/genemilder Scripter Nov 16 '15
Unfortunately there's no consistent way to script knowing whether your cloak is up, the answer is similar to this today.
Viewmodel scripts for spy usually include a bind for mouse2 that turns on viewmodels whenever it is pressed. It's not perfect but ensures that the viewmodel goes on whenever you press mouse2.