Try this one:
local i_state = {}
local keypressed = 0
function show_img_init(e)
LoadImages("Your image path here",1)
SetImagePosition(50,50)
SetImageAlignment(0)
i_state[e] = "unhidden"
end
function show_img_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 then
if i_state[e] == "unhidden" then
Prompt ("Your text here")
if g_KeyPressE == 1 and keypressed == 0 then
keypressed = 1
ShowImage(1)
i_state[e] = "hidden"
end -- g_KeyPressE == 1
elseif i_state[e] == "hidden" then
Prompt ("Press E To hide image")
if g_KeyPressE == 1 and keypressed == 0 then
keypressed = 1
HideImage(1)
i_state[e] = "unhidden"
end
end --i_state[e] == {"hidden"}
end -- PlayerDist < 100
if g_KeyPressE == 0 then keypressed = 0 end
end -- main
hth
edit; fixing script
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4