pinv = player.getInventory();

if(pinv.getSlotContainingItemDamage(351,4) != -1)
{
	player.setStunned(500);
	sound.playSoundUI("sound.habitantd");
	chat.print("Guard : Well, I see that you have an authorization with the King's seal, you are allowed to pass through.");
	time.sleep(6);
	player.setStunned(0);
	world.triggerBlock(523, 68, -284);
	pinv.emptySlot(pinv.getSlotContainingItemDamage(351,4));
}
else
{
	player.setStunned(500);
	sound.playSoundUI("sound.habitantd");
	chat.print("Guard : You can't continue, it's too dangerous.");
	time.sleep(3);
	sound.playSoundUI("sound.dialogue next");
	chat.print("You need an authorization signed by the king.");
	player.setStunned(0);
	time.sleep(4);
	sound.playSoundUI("sound.navilisten");
	chat.print("Navi : The King isn't in his castle... Where else could we get this authorization ?");
}