because you're not using time there but the fps which is going to be different for everyone (i.e. delaydoctor + 1 is updating every time the script is run which for faster computers is more often than slower ones)
you don't need both methods, remove the delaydoctor stuff completely and just check the timer.
p.s. it's better to use GetElapsedTime() rather than the GetTimer(e) methods as it will only update when called rather than all the time (so if you pause the game etc GetTimer(e) will continue to increase while GetElapsedTime() will not).
-- LUA Script - precede every function and global member with lowercase name of script
-- CDIS-John text display
local delay_between_text_change = 1
local displaytextdoctor = 0
local delaydoctor = 0
function doctor_init(e)
displaytextdoctor = 0
delaydoctor = 0
end
function doctor_main(e)
if g_Entity[e]['activated'] == 0 then
SetActivated(e, 1)
end
if g_Entity[e]['activated'] >= 1 then
delaydoctor = delaydoctor + GetElapsedTime()
if delaydoctor >= delay_between_text_change then
delaydoctor = 0
displaytextdoctor = displaytextdoctor + 1
end
if displaytextdoctor == 1 then
Panel(20,80,80,96)
TextCenterOnX(50,88,3,"Doctor: We lost Commisioner Tahir. I am so sorry for your loss.")
elseif displaytextdoctor == 2 then
Panel(20,80,80,96)
TextCenterOnXColor(50,86,3,"Tahir's Wife: He was doing his duty. Maybe he is in a better place." ,255,215,0)
TextCenterOnXColor(50,90,3,"His suffering ended but how am I going to endure this pain now?!" ,255,215,0)
elseif displaytextdoctor == 3 then
Panel(20,80,80,96)
TextCenterOnX(50,86,3,"Doctor: I am so sorry, we did everything we could")
TextCenterOnX(50,90,3,"but his injuries were too severe.")
elseif displaytextdoctor == 4 then
Panel(20,80,80,96)
TextCenterOnXColor(50,88,3,"Tahir's Wife: What am I going to do without him?" ,255,215,0)
end
end
end