Damaging players in spectator mode

Well, I’ve come across a slight issue in a project I’m working on.

I want players to control an object, so I have them spectate it. But once they are in spectator mode, they can no longer be damaged (via ply:TakeDamage).
I could write a custom spectate-ish code, but I thought i would ask here first if anyone knows how to damage players in spectate mode.

Thanks in advance,
-Jake

PS: If anyone knows any good alternatives to spectate, I’m all ears.

**[Gamemode.EntityTakeDamage

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.EntityTakeDamage)**

To be more precise, when the prop controlled by a player is damaged, you can grab the damage info from that hook, and the redirect it to the player using **[Entity.TakeDamageInfo

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.TakeDamageInfo)**.

[editline]01:46PM[/editline]

Oh wait, you mentioned that they can’t be damaged by TakeDamage, so the above post is super irrelevant. Congrats. Hold on, I’m going to look for a better solution.

[editline]01:51PM[/editline]

Okay, I didn’t really find any way to damage players while spectating. Maybe you can hook EntityTakeDamage, and remove health from the player using SetHealth instead of TakeDamage. It won’t really look good but that’s all I can think off.

Else, just write your own thirdperson spectating script, it’s not really hard using CalcView.

Or you could hook the player to the spectated object, so when the player just follows the objects health.

Simple.

You can’t just ‘hook’ objects to each other. You need to replicate the health loss on the player manually, like in the posts above yours.

Thanks for the help guys. I ended up rewriting CalcView to do what I wanted.