wizel1 0 Report post Posted May 8, 2019 (edited) any know how can prevent item usage again if already used? example: i want use roll and i accidently use it again it waste item i want prevent accident use so if use roll cannot use again until time up and display (you already use roll, please wait) Edited May 8, 2019 by wizel1 Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted May 9, 2019 There may be another way to do it, but this one is simple and efficient. Quote Share this post Link to post Share on other sites
wizel1 0 Report post Posted May 9, 2019 I look for somethingv diff want prevent from using same item twice not cool down Quote Share this post Link to post Share on other sites
Inuarashi 5 Report post Posted May 9, 2019 @wizel1you can create a script that checks if the character has the state already or not, for the item that you use. such as heaven berry have state_xxxxx, then do a check if state == 1, and if it does, prompt a message and return, end, before the consumption of the item. Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted May 9, 2019 Well, since u said Rolls, I tought u mean something like prevent using 2 hp recovery items. Those arent used with states, instead they just add hp to your attrs. If u want to avoid using twice an item that give states, as inuarashi said, take a look at Amplifiers itemeffect script. Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted May 9, 2019 Hello, @wizel1! ItemEffect.lua function ItemUse_wizel(role, Item) -- Check if item is already used if ( GetChaStateLv(role, <STATE_ID>) > 0) then SystemNotice( role, string.format( "%s is already used!", GetItemName(GetItemID(Item)) ) ) UseItemFailed(role) return end -- Item script -- . . . -- . . . -- . . . -- Add state <STATE_ID> for 60 seconds local statetime = 60 AddState(role, role, <STATE_ID>, 1, statetime) end skilleff.txt <STATE_ID> Item State -1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 -1 0 0 0 0 -1 0 0 0 0 0 0 0 <STATE_ID> is your ID for item state. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
wizel1 0 Report post Posted May 10, 2019 (edited) was wrong here? anyone know, the item work perfect. but this keep show in error is because it is duplicate and saying same thing? if so how can fix so remove from lua_err Edited May 10, 2019 by wizel1 Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted May 10, 2019 @wizel1 Check SetCharaAttr() call in function State_XUEYU_Add(). The first argument of SetCharaAttr() is nil, should be number. Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites