Oliver Hope 261 Posted December 1, 2018 (edited) Hey all I'm trying to find an efficent way of detecting when a player throws a grenade, preferably with an events listener, If this is not possible then id like to detect when they are holding one. i need to know when they are holding it at any given time not just when they say walk in a trigger zone thanks Edited December 1, 2018 by Oliver Hope_P1 Share this post Link to post Share on other sites
RedEagle_P1. 905 Posted December 1, 2018 Why not detect damage where it lands? Give everything 999999 health, make the nade do 0.1 damage, on damage do __. Share this post Link to post Share on other sites
Oliver Hope 261 Posted December 1, 2018 4 hours ago, RedEagle_P1. said: Why not detect damage where it lands? Give everything 999999 health, make the nade do 0.1 damage, on damage do __. several reasons: You wouldnt be able to detect if the grenade landed on terrain you cant set the price damage grenades do checking for damage on every game object probably isnt too efficent Share this post Link to post Share on other sites
Igor Q. 519 Posted December 2, 2018 (edited) Check post below. Edited December 2, 2018 by Igor Quintero Share this post Link to post Share on other sites
Igor Q. 519 Posted December 2, 2018 (edited) Okay I can't seem to recreate my trigger from before but this following code should be good enough for all intents and purposes. 1) Create a Entity Label and set it to contain a Grenade. 2) Create a Entity Template and set it to contain the same grenade. 3) In your Entity Label script On Entity Removed Entity Spawn Entity Template the system registers that when your grenade gets removed from the game this event triggers. The game "deletes" the grenade when item is thrown, not when it explodes. This means the trigger won't activate if you drop it on the ground, but will activate if you dismantle/break it. 4) In your Entity Template script On Entity Spawn Entity Attach Label Entity Entity Label Entity Label Edited December 2, 2018 by Igor Quintero Share this post Link to post Share on other sites
Oliver Hope 261 Posted December 2, 2018 13 hours ago, Igor Quintero said: Okay I can't seem to recreate my trigger from before but this following code should be good enough for all intents and purposes. 1) Create a Entity Label and set it to contain a Grenade. 2) Create a Entity Template and set it to contain the same grenade. 3) In your Entity Label script On Entity Removed Entity Spawn Entity Template the system registers that when your grenade gets removed from the game this event triggers. The game "deletes" the grenade when item is thrown, not when it explodes. This means the trigger won't activate if you drop it on the ground, but will activate if you dismantle/break it. 4) In your Entity Template script On Entity Spawn Entity Attach Label Entity Entity Label Entity Label Great idea thanks, i simplified it slightly and just used an event listener listening on type grenade. Share this post Link to post Share on other sites
Igor Q. 519 Posted December 2, 2018 1 hour ago, Oliver Hope_P1 said: Great idea thanks, i simplified it slightly and just used an event listener listening on type grenade. I tried using the event listener on "Ignite" but for some reason it did not produce consistent results. What did you use? Share this post Link to post Share on other sites
Oliver Hope 261 Posted December 3, 2018 23 hours ago, Igor Quintero said: I tried using the event listener on "Ignite" but for some reason it did not produce consistent results. What did you use? i used the on entity removed from inventory, I painted and renamed a vacuum tube to a smoke bomb and you just press x to use it Share this post Link to post Share on other sites