Thanks Pirate Myke for the tips... but same result...
The only way to have the " targets remain " message box changing is if I shoot on the object.
In this case, the script works fine... but the "target" objects are still "alive"... and do not disappear...
Note that the script I have associated to the "target" objects is just to make them rotating and for the distance detecting with the player :
local delay = {}
local init_delay = {}
GravityOff(e)
function rotation_objet_init(e)
delay[e] = 25
init_delay[e] = delay[e]
rotation = 0
end
function rotation_objet_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 500 then
if GetTimer(e) > delay[e] then
delay[e] = GetTimer(e) + init_delay[e]
SetRotation(e,0,rotation,0)
rotation = rotation + 5
if rotation > 360 then
rotation = 0
end
end
end
if PlayerDist < 80 and g_PlayerHealth > 0 then
PlaySound(e,0)
SetEntityHealth(e,0)
Destroy(e)
--ActivateIfUsed(e)
end
end