This post has been marked by the post author as the answer.
you have the objective item set to alwaysactive = yes which means the script will still run as it can't be destroyed
if you need the objective item to always be active for some reason you can swap state to make the script not run the unwanted code... i.e.
-- use to add objectives to your level
haveAddedObjective = {}
local collected = {}
function objective_init(e)
haveAddedObjective[e] = 0
collected[e] = 0
end
function objective_main(e)
if collected[e] == 1 then return end
if haveAddedObjective[e] == 0 then
if addObjective ~= nil then
addObjective(e)
end
haveAddedObjective[e] = 1
end
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 and g_PlayerHealth > 0 then
PromptDuration("You have reached an objective",3000)
PlaySound(e,0)
SetEntityHealth(e,0)
collected[e] = 1
Destroy(e)
end
end
to count how many you have collected use a variable in the radar script (which does need to be alwaysactive = yes) like "objectives_collected = 0" then in the objective.lua above Destroy(e) put "objectives_collected = objectives_collected + 1"
then you can prompt / use that variable as you need