Scripts / How to detect the death of an object?

Author
Message
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 12th Dec 2015 18:56
I feel like I'm missing something simple but I want to find a way to activate a script upon the death of an object.
Any takers?
Recently updated my review blog.

http://gamegurureport.blogspot.com
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 12th Dec 2015 19:41
SetEntityHealth(e,0)
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 12th Dec 2015 20:34
Hi,

SetEntityHealth(e,0) - will set the entity's health to the value. ie: zero
and
g_Entity[e]['health'] - is used to check the entity's health.

So to check for a death...

if g_Entity[e]['health'] <= 0 then
-- Do something
end

Cheers
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 15th Dec 2015 18:46
The check is what I needed, thanks.
Recently updated my review blog.

http://gamegurureport.blogspot.com

Login to post a reply

Server time is: 2024-12-22 10:08:29
Your offset time is: 2024-12-22 10:08:29