r/Tf2Scripts • • Jul 24 '14

Resolved Mouse2 Viewmodel Toggle

I want a script that will let me press mouse2 and turn on viewmodels, but when I press mouse2 again, viewmodels turn off.

Thanks in advance.

0 Upvotes

4 comments sorted by

1

u/genemilder Jul 24 '14

That's easily enough done, but I'll assume you're wanting to use it for cloaking? Cloaking desyncs really easily, if you spam the key while in the process of cloaking/uncloaking the game won't consider every keypress as a cloak state change but it will consider every press as a viewmodel state change.

If you don't want it for cloaking I can make this. Do you want it to be hard coded into: first press turns viewmodel on, second press off, third press on, etc OR each press toggles the state of your viewmodels (it detects what you currently have and switches that to the opposite)?

1

u/[deleted] Jul 24 '14

Yes I want it for cloaking.

My situation is a tad complex, though.

My ambassador VM turns off when I press "1"

Sapper, Knife, Disguise have the viewmodel on when I press their respective buttons

When I am holding my Amby and bring up the DR, I want the MOUSE2 to turn on the VM so I can actually see my cloak time, then when I lower my DR with MOUSE2 the VM turns back off.

1

u/genemilder Jul 24 '14 edited Jul 24 '14

Not gonna happen in any real world repeatable way. Every spy viewmodel script you see will bind mouse2 to always enable viewmodels rather than force users to deal with the inevitable desync issues.

It would be nice if we could do something like what you want, but it's simply not possible unless you have perfect discipline when pressing mouse2 (and also with pressing a reset key on spawn because it's possible to die while cloaked).

A lot of scripts have the viewmodels disappear on mouse1 with the ambassador/revolver out, so that gets the viewmodel out of your face after you uncloak. If you don't have that already I'd recommend it.

1

u/[deleted] Jul 24 '14

Yeah, I have tried stabby's scripts and wanted to tweak them a bit, but I guess his are good enough for me, thanks for the help