Answer the question
In order to leave comments, you need to log in
How to send a message about the death of a player in the chat, only 1 time?
I have an object of class Life which has a boolean field death.
I want to work out an event where when a field changes from false (not dead) to true (dead) the
Server sends ONLY ONE TIME a message to the chat.
The problem is that the death field can be true for a while (due to the fact that the player pops up the Respawn menu, where until he respawns, his field will be true), and because of this, the script may work a few once.
public void CheckDeathPlayers()
{
for (int i = 0; i < UserList.users.Count; i++)
{
BetterNetworkUser player = UserList.users[i];
Life plife = player.player.GetComponent<Life>();
if (plife.bool_2)
{
DeathMsg(player.name, plife.string_0);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question