g_killcount = g_killcount or 0 local randomtime = {} local game_timer_started = {} local posx = {} local posy = {} local targetmoveup30 = {} function cannonshot_init( e ) randomtime[e] = math.random( 500, 5000 ) ` game_timer_started[ e ] = false targetmoveup30[e] = false end function cannonshot_main( e ) local Ent = g_Entity[ e ] if not game_timer_started[ e ] then if GetPlayerDistance( e ) < 1400 then game_timer_started[ e ] = true StartTimer( e ) end return elseif not targetmoveup30[ e ] and GetTimer( e ) > randomtime[ e ] then targetmoveup30[ e ] = true elseif targetmoveup30[ e ] then posy[ e ] = Ent.y posy[ e ] = posy[ e ] + 10 SendMessageF( "resetpositiony", e, posy[ e ] ) --MoveUp(e,100) posx[ e ] = Ent.x posx[ e ] = posx[ e ] + 8 SendMessageF( "resetpositionx", e, posx[ e ] ) if Ent.health < 1 if Ent.y < 3000 then g_killcount = g_killcount + 1 targetmoveup30[ e ] = false end elseif Ent.y > 3000 then Destroy( e ) targetmoveup30[ e ] = false end end end