Quote: "smallg`s script didnt work for me "
You might want to use the StartTimer and GetTimer functions as they would make the code a bit simpler and not too difficult to make work. Just use StartTimer to get the ball rolling and then GetTimer to see if the required time has elapsed. This is not a full script, but just the basic idea:
local timerStarted = {};
function mystory_init(e)
timerStarted[e] = 0;
end
function mystory_main(e)
-- use standard code to get PlayerDist here
if PlayerDist < 100 then
if timerStarted[e] == 0 then
StartTimer(e);
timerStarted[e] = 1;
else
if GetTimer(e) <= 1000 then
Prompt("First line of story");
elseif GetTimer(e) > 1000 then
Prompt("Second line of story");
elseif GetTimer(e) > 2000 then
Prompt("Third line of story here");
elseif GetTimer(e) > 3000 then
Prompt("Fourth line of story here");
end
end
else
-- can't remember if this is even a function, but if it is it would go here
StopTimer(e);
end
end
The timer checks for 1000, 2000, 3000, etc. are in milliseconds so each one is a one second interval. Adjust according to your needs.
System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.007