Greetings
Please, will someone be able to assist with this minor code I am trying to put together? Alas I have no skills besides minor stuff like spawning entities and notes etc. I want to spawn an entity, line of text, sound or what ever, after a timed delay when triggering a zone.
My logic says;
player in zone
start timer
get timer
if time X then
spawn X.
close script
But everything I have tried falls flat. Can anyone help? Many thanks. My attempts below Thanks in advance.
function ai_wait2_init(e)
end
function ai_wait2_main(e)
if g_Entity[e]['plrinzone']==1 then
StartTimer(e)
GetTimer(e)
end
if GetTimer(e) == 3000 then
Spawn(4)
end
end
and
local timer = 5000
function ai_time_init(e)
StartTimer(e)
end
function ai_time_main(e)
if g_Entity[e]['plrinzone'] == 1 then
GetTimer(e)
end
if g_Time - g_Entity[e]['timer'] == 5000 then
Spawn(4)
end
end
function ai_time_exit(e)
end
and finally
local wait_duration = 4000
function ai_wait_init(e)
--wait[e] = 1
--StartTimer(e) --== 1
end
function ai_wait_main(e)
if g_Entity[e]['plrinzone']==1 then
StartTimer(e)
GetTimer(e)
end
if g_Entity[e]['timer'] == wait_duration then
Spawn(4)
end
end
Thanks for reading. This is driving me nuts