Hi, can someone help me out with this, i tried adding health to the entity wall and the lua script that i have added on the entity wall is named ammocount , now the problem is , when i tried firing on that wall at CLOSE RANGE my script works correctly, by adding 1 ammo on the ammo variable, however when i tried firing on that wall again from AFAR , it adds a significant random huge number which is greater than 1 instead of 1 ...
Here is my script
function ammocount_init(e)
SetEntityHealth(e,10)
end
function ammocount_main(e)
[img]null[/img]
if g_Entity[e]['health'] <= 0 then
Ammo = Ammo + 1
Accuracy = Score / Ammo
SetEntityHealth(e,10)
end
end
Here is a screen shot when i tried firing the wall entity at CLOSE RANGE
Here is a screenshot when i tried firing the wall again for the 2nd time from AFAR