With plants, I want 5 ingredients to be worth 1 Animal Feed portion.
How do I script this to happen without wastage?
For example...
set numApples to Player.GetItemCount Apple ;(numApples = how many apples player has) set numAnimalFeed to numApples / 5 ;(numAnimalFeed = how many apples player has divided by 5. So 1 AnimalFeed per 5 Apples) if Player.GetItemCount Apple >= 5 ;(Player has atleast 5 apples) Player.RemoveItem numApples ;(Remove all apples player has in inventory) Player.AddItem AnimalFeed numAnimalFeed ;(Player gets AnimalFeed at one fifth of the amount of apples.) endif
This code gives me 1 Animal Feed per 5 apples.
But the problem is that all the Apples a player has are removed. So if player has 12 apples, he loses all 12 and gets 2 Animal Feed. Thats a wastage of 2 apples.
How can I script it to only take apples that make up a whole animal feed and leave any remainders?