Server's player health is affecting clients

Hi

The player has 2 parts to their health system: battery and health.

The player’s battery slowly drains and once it reaches 0 it starts dealing damage to the player.

The client’s health and battery values appear to be completely unaffected by anybody else other than their own. Meaning using items to replenish their battery and/or health updates their values correctly.
However after a while they both die no matter what their health value is.

I’ve checked with print strings and there is no mistaking that their values are completely unchanged by anything, yet they are still dying.

What I suspect is that the server’s “hidden player” (on dedicated server ) is still counting down and dealing damage to itself whereupon it fires any events associated with health to all clients.
I am not completely sure how to resolve this issue or maybe my diagnosis is wrong.

All of this is handled within my player character BP.

This is the event set by a timer to “drain” the battery.

Inside the OnTakeDamage function:

To summarize:

Client players die after a set amount of time despite their health values being fine. Cause is the server still dealing damage to its own health which it then fires off the death event for all clients.

Problem Solved but not quite sure why

Upon further experimentation it appears that it is in fact other clients variables that are affecting each player.

The event begin play node was firing multiple times for each character in the world. So 2 times for 2 players 3 times for 3 etc.

Each players health was not independent to themselves for whatever reason. It was as if the player had multiple health bars they could not modify.

So Client 1 could see that client 2 and 3s battery were going down and nothing could be done even though they had replenished their battery on their end. It still showed up as if they never had to the first client thus triggering the death for everyone.

Same for all clients in the game.

Extremely weird situation, Maybe has something to do with the player pawn being replicated? No other variables in the BP have this problem though.

This is how I fixed it:

http://i.imgur.com/p5uk1nE.png

This just makes sure that only those relevant being play events are set for this player. Doesn’t quite feel as if its the right thing and there is an actual direct fix for the problem but it works.