You need to get the animation frames for the talking animations, and then play them using the PlayAnimation(e) command. You'll need to use a flag of some sort to check whether or not the animation has started, otherwise the animation will start x times per second (whatever your frame rate is) and will never actually play.
For example, if your animation frames are 300-350, you could use this code.
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(300,350)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
You could use the Prompt command with a timer to show the text, with a variable to determine which line is displayed. The duration is in milliseconds.
For example
function convo_init(e)
convo = 0
timer = 0
timerstarted = 0
end
function convo_main(e)
if GetPlayerDistance(e) <150 and convo == 0 then
Prompt("press e to talk")
if g_KeyPressE == 1 then
convo =1
end
end
if convo == 1 then
Prompt("Says a bunch of dumb stuff")
if timerstarted == 0 then
timer = GetTimer(e)
timerstarted = 1
end
if GetTimer(e)-timer > 3000 then
convo = 2
timerstarted = 0
end
elseif convo == 2 then
Prompt("Says a bunch of even dumber stuff")
if timerstarted == 0 then
timer = GetTimer(e)
timerstarted = 1
end
if GetTimer(e)-timer > 3000 then
convo = 3
timerstarted = 0
end
end
end
The timer duration will depend on how long that particular line takes to speak - you'll have to use trial and error to work this out.
Edit : I'm guessing that the talking animation is just lips moving, and not actual lip-synching, so you should use LoopAnimation(e) rather than PlayAnimation(e)