state = {} fire_delay = {} bullets = {} function rookie_init(e) bullets[e] = 8 state[e] = "training" end function rookie_main(e) if fire_delay[e] == nil then fire_delay[e] = g_Entity[e]['health'] SetEntityHealth(e,5000) else if state[e] == "training" then if GetPlayerDistance(e) < 750 then if bullets[e] > 0 then if GetTimer(e) > fire_delay[e] then if g_Entity[e]['animating'] == 0 then PlaySound(e,1) bullets[e] = bullets[e] - 1 SetAnimationFrames(573,597) PlayAnimation(e) g_Entity[e]['animating'] = 1 end StartTimer(e) end else if g_Entity[e]['animating'] == 0 then SetAnimationFrames(685,730) PlayAnimation(e) g_Entity[e]['animating'] = 1 elseif GetAnimationFrame(e) >= 729 then bullets[e] = 8 end StartTimer(e) end else StartTimer(e) end elseif state[e] == "attack player" then RotateToPlayer(e) if g_Entity[e]['plrvisible'] == 1 then if GetTimer(e) > fire_delay[e] then HurtPlayer(e,5) StartTimer(e) end end if GetPlayerDistance(e) > 800 or GetTimer(e) > 4000 then state[e] = "training" SetEntityHealth(e,5000) end end if g_Entity[e]['health'] < 5000 then state[e] = "attack player" end end end function rookie_exit(e) end