• Hey! Register here to create your account, engage with the community, and talk about what is new!

detect player death

OP_orange

New member
Joined
Jun 12, 2022
Messages
3
Reaction score
0
so i am making a game (bomb battles) where you shoot TNT at other players to kill them.

i want to make a scoreboard displaying the top killers and make a points system to buy new weapons with kills however i am unable to detect if a player has died to tnt. i have tried every player and entity death/kill event and it just doesn't work.

thanks for your help in advance!
 
Solution
thanks for the reply, do you know where the damage event cause actually is.... i cant find it :(
Of course, and here is a more detailed walkthrough!

After player death event, Set a variable. Call it something like %default damageCause. Now go into your Values menu, and grab a Game Value. Right click the game value - > click Event Values - > then, click Damage Event Cause. This returns a String, or a text, for whatever damage cause it detects. If it detects an explosion, it sets the variable to "block_explosion". So after that, place the variable inside, and then place the Damage Event Cause alongside it.

Then, use an If Variable to detect if your variable "damageCause" is = to "block_explosion". So simply place the variable...

Refrizor

Retired Administrator
Retired Admin
Joined
Aug 16, 2020
Messages
513
Reaction score
362
Screenshot_20220706-181355_Discord.jpg

I hope this helps! For player death event try checking the damage cause, check if its block explosion. If you need more specific details I can login later!
 
Last edited:

Refrizor

Retired Administrator
Retired Admin
Joined
Aug 16, 2020
Messages
513
Reaction score
362
thanks for the reply, do you know where the damage event cause actually is.... i cant find it :(
Of course, and here is a more detailed walkthrough!

After player death event, Set a variable. Call it something like %default damageCause. Now go into your Values menu, and grab a Game Value. Right click the game value - > click Event Values - > then, click Damage Event Cause. This returns a String, or a text, for whatever damage cause it detects. If it detects an explosion, it sets the variable to "block_explosion". So after that, place the variable inside, and then place the Damage Event Cause alongside it.

Then, use an If Variable to detect if your variable "damageCause" is = to "block_explosion". So simply place the variable inside the chest in the if variable, and grab a text, name it "block_explosion", and put it alongside the variable. Hope this helps! :)
 
Solution
Top Bottom