use either avrams timer or os.time()
need to do 2 time checks (1 just once and the other constantly) and compare them, once the 2nd is bigger than the desired time you can then remove the prompt
using basic lua commands
time1set = 0; pressed = 0;
delayrequired = 2 --change value here to set howmany seconds to display prompt for
function timedprompt_main(e)
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;
PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;
PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));
if PlayerDist < 80 and pressed == 0 then
if time1set == 0 then
time1 = os.time()
time1set = 1
end
time2 = os.time()
timepassed = time2 - time1
if timepassed <= delayrequired then
Prompt("enter prompt here")
--would add hide entity command here once 1.007 is out
else
time1set = 0
Destroy(e)
end
end
if g_KeyPressE == 0 then
pressed = 0
end
end
using avrams addon you can do much more however so i would recommend checking it out
https://bitbucket.org/Avram/fpsc-r-toolkit/wiki/aTimer
life's one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11