Tuesday, April 17, 2012

How Would i Enable a Health Drain On a Unit?

Is it possible to enable a health drain on a unit ? For an ability I'm working on i would like the unit to drain in health when its in use if over used the unit would die any ideas thanks.|||Probably not via stock buffs, but you can just start a thread on the unit that cycles every 0.1s and does a self:AdjustHealth(self, -amount) every loop iteration, killing the thread whenever the ability is turned off.
If you're not familiar with killing threads, just make sure you launch the thread into a handle, e.g. self.DrainThread = self:ForkThread(self.DrainFunction, arg1, arg2), and kill the thread with KillThread(self.DrainThread).

No comments:

Post a Comment