Hello, I have put together a nice little cloak swep for my server.
The cloak swep works by holding it out and right clicking to toggle cloak on or off.
The swep works fine apart from one issue, if a player has cloak active, dies and then respawns, the cloak is still active even if he does not have the weapon.
The current code, which works fine, to toggle the cloak is the following:
I have tried using the following to uncloak the player when they die:
I am not sure if I am approaching this the right way though.