Try this I modified you original code with a heap of comments for you. This is working for me as well.
Interesting to see if this one works for you...
-- Player Collecting The Golden Orb
gold_orb = 0
g_imgBackdrop = 0
function pick_gold_orb_init(e)
end
function pick_gold_orb_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 80 and g_Entity[e]['collected'] == 0 and g_PlayerHealth > 0 then -- need to add a flag to stop the event from happening again
Prompt ("Press E To pick up Golden Orb")
if g_KeyPressE == 1 and g_Entity[e]['collected'] == 0 then -- need to add a flag to stop the event from happening again
gold_orb = gold_orb + 1
PromptDuration("Collected Golden Orb. You now have "..gold_orb.." Goldern Orb's.",6000) -- orb count added to this prompt instead
PlaySound(e,0)
g_imgBackdrop = LoadImage("scriptbank\\images\\golden_globe\\ten.png")
g_sprBackdrop = CreateSprite( g_imgBackdrop )
SetSpritePosition( g_sprBackdrop,90,2 )
--Prompt (gold_orb) -- not needed as you have PromptDuration("Collected Golden Orb",6000) above, this will override the above prompt
--Destroy(e) -- if you destroy it here the entity no longer exists so the timer wont work as it is destroyed as well. use hide and collision off instead then you destroy it later
Collected(e) -- this changes the g_Entity[e]['collected'] = 0 flag, to g_Entity[e]['collected'] = 1
Hide(e)
CollisionOff(e)
SetPlayerHealth(g_PlayerHealth+50)
StartTimer(e) -- starts the timer at zero, if the timer is allready running it resets the timer back to zero
end
end
if g_Entity[e]['collected'] == 1 and GetTimer(e) > 8000 then -- if the item is collected and timer is greater than 8 seconds
PromptDuration("Collected Golden Orb - Health increased by 50 points - NEXT LEVEL ATTAINED",4000)
DeleteImage ( g_imgBackdrop )
DeleteSprite ( g_sprBackdrop )
Destroy(e) -- destroying the entity
--I WANT TO DELETE OR HIDE THE GOLDEN GLOBE IMAGE AFTER 8 SECONDS HOW ?
end
-- For testing
--TextColor(5,10,3,"GetTimer "..GetTimer(e),255,255,255)
--TextColor(5,13,3,"Collected: "..g_Entity[e]['collected'],255,255,255)
--TextColor(5,16,3,"Orb Count: "..gold_orb,255,255,255)
--TextColor(5,19,3,"Distance: "..math.ceil(PlayerDist),255,255,255)
end
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)