Keuvyn T. 3 Report post Posted June 6, 2017 Hello Pkodev! I've been researching but I could not find something that could give me this I want, could any one help me? How can I make a chest give Gems Lv1-4 as the following example: Chest of Soul Package: Give Lv1, Lv2, Lv3 and Lv4 Gem of Soul and Lv1, Lv2, Lv3 and Lv4 Refining Gem. Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted June 6, 2017 -- [[ -- @function GiveGemSet -- @param cha - target -- @param gemid - the specified gem -- @param gemlv - the level of the gem. (e.g: 4 would grant lv1-4 gems) -- @param addref - flag to give refining gems. (true = give. false = dont give) -- ]] function GiveGemSet(cha, gemid, gemlv, addref) local checkgrid = GetChaFreeBagGridNum(cha) local needgrid = gemlv*2 if checkgrid <= needgrid then SystemNotice(cha, 'Requires '..needgrid..' inventory slot. Failed to open Chest.') UseItemFailed(cha) return end for i = 1, gemlv do local lv = 100 + i GiveItem(cha, 0, gemid, 1, lv) if addref then GiveItem(cha, 0, 00885, 1, lv) end end end I did not test... so please test thoroughly =) Usage: function ItemUse_*(role, Item) GiveGemSet(role, 863, 4, true) end 1 Quote Share this post Link to post Share on other sites