the idea is a map spawn a metin and he must destroy it before the time is done or he must retry after hour i found some problems hope some 1 helps me
quest test begin
state start begin
when login or level_up with pc.get_map_index() == 74 begin
loop_timer("check_time", 1)
set_state(kill)
end
end
state kill begin
when letter begin
send_letter(" تجربة ")
end
when button or info begin
if pc.getqf("time_retry") <= get_time() then
local Blue = {{100, 22, 8001},{101, 22,8002},{102, 22, 8003},{103, 22,8011},{104, 22,8013},{105, 22,8024},{106, 22,8026},{107, 22,8027},{108, 22,8027},{109, 22,8027}}
for i = 1,1 do
if pc.level > Blue[i][1] then
mob.spawn(Blue[i][3], pc.get_local_x()+5, pc.get_local_y()+5, 1)
pc.setqf("limit_time", get_time()+60*5)
end
end
end
when Blue[i][3].kill begin
local count = pc.getqf("state") + 1
if count <= 1 then
pc.setqf("state", count)
q.set_counter(" يجب قتل ", 1 )
end
if count >= 1 pc.getqf("limit_time") == get_time() then
say(" fail ")
say(" اعد المحاولة بعد ساعة ")
pc.setqf("time_retry", get_time()+60*60*1)
elseif count == 1 and get_time() < pc.getqf("limit_time") then
say (" mbrok exp ")
pc.give_exp(Blue[i][2])
clear_letter()
set_state(__COMPLETE__)
end
end
end
state __COMPLETE__ begin
end
end