Jump to content
woobla

remove item after create recipe

Recommended Posts

Posted (edited)

Hello. Please helps!
We are making a recipe.
In the recipe, we execute a function in the onCreate event that adds items item1 and item2.
I need to remove item3.
Does anyone know how to do this?
inv:remove("TestMod.Item3"); - does not work

 

function recipe_CreateItems(items, result, player)
	local inv = player:getInventory();
	inv:AddItems("TestMod.Item1",2);
	inv:AddItems("TestMod.Item2",3);
	inv:remove("TestMod.Item3");
end

 

recipe Create Two Items
{
  Result:item3,
  Sound:AddItemInRecipe,
  Time:100.0,
  Category:Farming,
  OnGiveXP:Give10CookingXP,
  NeedToBeLearn:true,
  OnCreate:recipe_CreateItems,
}

 

Issue resolved.
You need to add RemoveResultItem:true to the recipe,

Edited by woobla

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...