draoth 13 Posted March 26, 2017 Welcome, To keep this short : _hit = 0 I want this variable to increase everytime the object _Str been hit. _Str addEventHandler ["HitPart",{_hit = _hit + 1}]; This doesn't work because the EH doesn't know the localvariable. _Str addEventHandler ["HitPart",{hit = hit + 1}]; This does work because it is a globalvariable. But i need it to be a localvariable, because there are 200 objects that are being spawned using the same variable. waitUntil {_Hit > 3}; deletevehicle _Str; I want the obj to delete itself after being hit 3 times. Is there workaround that i can use? Or maby a different way to approach this? Draoth Share this post Link to post Share on other sites
froggyluv 2130 Posted March 26, 2017 Cant you just have the eventhandler call a function that handles the hit=hit+1? Thats what i do Share this post Link to post Share on other sites
draoth 13 Posted March 26, 2017 21 hours ago, froggyluv said: Cant you just have the eventhandler call a function that handles the hit=hit+1? Thats what i do Can you explain it? I don't really know what you mean by that? Share this post Link to post Share on other sites