I'm trying to script so that when I use an inventory on a character I get a new inventory item and lose one. And then if you click the new item on it you get a new message, but for some reason all inventory items do the same action.
This is what I have in the script. I'm new to scripting and I'm sure I made a minor mistake.
function cFruit_UseInv()
{
if(player.ActiveInventory == iemptycup)
cEgo.Walk(149, 146, eBlock);
Display("Roger waves the empty cup under the giggling red fruit, eventually enough fruit juice spills into the cup. It almost looks like human blood.");
cEgo.AddInventory(icupofblood);
cEgo.LoseInventory(iemptycup);
if(player.ActiveInventory == icupofblood)
cEgo.Walk(149, 146, eBlock);
Display("You have plenty of fruit juice.");
}
This is what I have in the script. I'm new to scripting and I'm sure I made a minor mistake.
function cFruit_UseInv()
{
if(player.ActiveInventory == iemptycup)
cEgo.Walk(149, 146, eBlock);
Display("Roger waves the empty cup under the giggling red fruit, eventually enough fruit juice spills into the cup. It almost looks like human blood.");
cEgo.AddInventory(icupofblood);
cEgo.LoseInventory(iemptycup);
if(player.ActiveInventory == icupofblood)
cEgo.Walk(149, 146, eBlock);
Display("You have plenty of fruit juice.");
}