PNZ (Guess 3 unique digits in order)
JavaScript (ES6) 184 187 195

Edit Saved 8 bytes thx @Neil
Edit Saved 3 bytes thx @user81655

(newlines counted as 1 byte)

d=[...'0123456789']
x=[10,9,8].map(l=&gt;d.splice(Math.random()*l,1))
for(c=p=a='';!p[2];++c)g=prompt(a),n=p='',x.map((d,i)=&gt;d-g[i]?~g.search(d)?n+='N':0:p+='P'),a=p+n||'Z'
alert(a+' '+c)


Test



d=[...'0123456789']
x=[10,9,8].map(l=&gt;d.splice(Math.random()*l,1))
for(c=p=a='';!p[2];++c)
  g=prompt(a),
  n=p='',
  x.map((d,i)=&gt;
        d-g[i]?~g.search(d)?n+='N':0:p+='P'
       ),
  a=p+n||'Z'
alert(a+' '+c)