# Rpg quest / inventory question

**URL:** https://forum.kirupa.com/t/rpg-quest-inventory-question/162866
**Category:** Uncategorized
**Created:** [September 17, 2005, 12:36am UTC](https://forum.kirupa.com/t/rpg-quest-inventory-question/162866 "2005-09-17T00:36:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oicu812](https://avatars.discourse-cdn.com/v4/letter/o/f475e1/32.png) [@oicu812](https://forum.kirupa.com/u/oicu812)
#### Post date: [September 17, 2005, 12:36am UTC](https://forum.kirupa.com/t/rpg-quest-inventory-question/162866/1 "2005-09-17T00:36:46Z")

</div>

i need an example of code. basically im trying to get a quest system working where the hero visits a npc which gives him a quest to return with a head as the quest item. when the hero kills the desired monster it places the head in the inventory, and when you return to the quest npc a check is made to see if the quest item is in your inventory. if it is then you get the reward, if you dont he tells you he is still waiting for the head.

//monster temp  
\_root.mName = “Orc”  
\_root.mLoot = “Orc Head”

//quest npc  
\_root.nName = “King”  
\_root.qItem = “Orc Head”

//i dont need help with the \_root.txt’s just giving u example of what i want  
\_root.txt = “Bring me the head of the Orc that is attacking our town.”  
//insert check inventory code here, and if true:  
\_root.txt = “Well done” + \_root.name + “, you recieve” + \_root.qGP + “gold”  
//if it is false:  
\_root.txt = “Im still waiting on that head” + \_root.name + “!”  
\_tellTarget(\_root.message){  
gotoAndPlay(“scroll”)  
}

could someone give me an example of a little inventory system and how to check if qItem is in the inventory? Im also open to suggestions on better ways to code this.
