flamyman1412 4 Report post Posted November 20, 2021 I will kill a mob by giving money, for example lv 1-20 mob gives 1000 G. 21-40 gives 2000 G what do i have to do Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted November 20, 2021 4 hours ago, flamyman1412 said: I will kill a mob by giving money, for example lv 1-20 mob gives 1000 G. 21-40 gives 2000 G what do i have to do Look into this thread, you might find something similar or use it (it defines mobs by ID) 1 Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted November 20, 2021 Hello @flamyman1412! Add this script to file functions.lua: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) else if (level < 41) then AddMoney(role, 0, 2000) end end end 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
flamyman1412 4 Report post Posted December 7, 2021 On 11/21/2021 at 12:58 AM, V3ct0r said: Hello @flamyman1412! Add this script to file functions.lua: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) else if (level < 41) then AddMoney(role, 0, 2000) end end end Why am I not leveling up and have to re-enter? Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted December 8, 2021 21 hours ago, flamyman1412 said: Why am I not leveling up and have to re-enter? It is hard to say what is the problem. Perhaps your server files contains some modifications that led to the existance of such a bug. 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
VItal13 1 Report post Posted December 8, 2021 21 час назад, flamyman1412 сказал: Why am I not leveling up and have to re-enter? Replace this: -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) else if (level < 41) then AddMoney(role, 0, 2000) end end On this: -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) elseif (level < 41) then AddMoney(role, 0, 2000) else -- >= 41 AddMoney(role, 0, 3000) end Quote Share this post Link to post Share on other sites
flamyman1412 4 Report post Posted December 8, 2021 1 hour ago, VItal13 said: Replace this: -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) else if (level < 41) then AddMoney(role, 0, 2000) end end On this: -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) elseif (level < 41) then AddMoney(role, 0, 2000) else -- >= 41 AddMoney(role, 0, 3000) end Thanks, I'll try to test it again. Quote Share this post Link to post Share on other sites
flamyman1412 4 Report post Posted December 8, 2021 2 hours ago, V3ct0r said: It is hard to say what is the problem. Perhaps your server files contains some modifications that led to the existance of such a bug. I will try to test Find the cause of the bug again. Thanks for the suggestion. Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted July 26, 2022 On 11/20/2021 at 8:58 PM, V3ct0r said: Hello @flamyman1412! Add this script to file functions.lua: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Give money to player if (level < 21) then AddMoney(role, 0, 1000) else if (level < 41) then AddMoney(role, 0, 2000) end end end The code above has a bug. Fixed version: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!", GetChaDefaultName(monster), money ) ) end end 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