OK i wrote you a script (no need to change the name or location of your image):
g_kills = 0
function kills_init(e)
----- Icon
kills_icon_posX = 50
kills_icon_posy = 50
kills_icon_sizeX = 20
kills_icon_sizey = 20
----- Text
kills_text_posx = 50
kills_text_posy = 50
kills_text_size = 5
kills_sprite = LoadImage("scriptbank\\images\\vcity\\10.png")
kills_icon = CreateSprite(kills_sprite)
SetSpriteSize (kills_icon,kills_icon_sizeX,kills_icon_sizey)
SetSpriteDepth (kills_sprite, 100)
SetSpritePosition(kills_icon,300,300)
end
function kills_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 and g_kills >= 10 then
PasteSpritePosition(kills_icon, kills_icon_posX, kills_icon_posy)
end
TextCenterOnX(kills_text_posx,kills_text_posy,kills_text_size,""..g_kills)
end
Put it in a dynamic, always active entity
in ai_soldier.lua (best work with copies if you are editing default scripts), find:
unction ai_soldier_exit(e)
if ai_soldier_state[e] ~= "deathanim" then
PlayCharacterSound(e,"onDeath")
end
and change it to:
unction ai_soldier_exit(e)
if ai_soldier_state[e] ~= "deathanim" then
PlayCharacterSound(e,"onDeath")
g_kills = g_kills+1
end
that should do the job for you.
Note: in the init I added variables for size, and position of the text and the images so you can change it easily.
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.