Thanks for the input guys, I don't have time today to fire up Arma2.
I'm still a bit puzzled though
UnitName addEventHandler ["hit", {HitVariable = HitVariable + 1}];
That's what I tried first and the Hitvariable won't increment .
The only difference was it had the underscore at the front ie "_HitVariable" I'm also using it in an sqf script if that makes a difference. The "_HitVariable" worked perfectly outside the eventhandler so I know that part works.
I also tried my own version of calling a second script without success but I didn't know how the array worked.
I'm also not sure how I would get the variable back into the first script where I need it.
Using the two script version all I would need an
_HitVariable = _HitVariable + 1
and then be able to send the result back. But wouldn't this cause an error as _HitVariable isn't defined in the second scrip?
If I do define it _HitVariable=0 it's always going to 1 on exit as it's always getting reset, I think that's where I got stuck last time.
Sorry if I don't make much sense.