How to use OnTriggerEnter and OnTriggerExit in multiplayer game

Hi. I’m making a multiplayer game and trying to reduce towers health when player enters in the area. When player enters in, the client will send a message to server, and server will tell both two clients to call the function “ReduceTowerHealth”.

That’s OK. But it will work only for one time. How can I make it continue ? If I send message everytime player stays in the tower area, it would get so much slower.

I solved it. When player1 enters in Tower2, the server will tell the clients to make a boolean true. And in Update, if boolean is true, towers health will reduce.

When player1 exits from tower2, the server will tell the clients to make the boolean false. And the function in Update will not execute.