heinsenberg 0 Report post Posted December 5, 2023 I'm having problems with the energy shield, the skill is active, but when I receive attacks, HP is being hit instead of SP, can anyone help me solve this Quote Share this post Link to post Share on other sites
Magicsea Online 121 Report post Posted December 5, 2023 Hi! check your struct function Hp_Dmg function Hp_Dmg(role, dmg) ... local statelv_mfd = GetChaStateLv(role, STATE_MFD) if statelv_mfd >= 1 then -- state magic sheld is above 1 ... if dmg / sp_change <= sp then sp = math.floor(sp - dmg / sp_change) else hp = math.floor(hp - (dmg / sp_change - sp)) sp = 0 RemoveState(role, STATE_MFD) end else -- whithout magic sheld ... end SetCharaAttr(sp, role, ATTR_SP) SetCharaAttr(hp, role, ATTR_HP) end 1 Quote Контакты: Сайт: https://magicseaonline.com/ Telegram: https://t.me/magicsea_online - здесь мы публикуем последние новости по разработке Discord: https://discord.gg/nqkv76YVbj Группа VK: https://vk.cc/chjbzd Чат VK: https://vk.cc/chjc8L YouTube: https://www.youtube.com/@magicsea_online Форум: https://forum.magicseaonline.com Служба поддержки: https://magicseaonline.com/support База знаний: https://magicseaonline.com/knowledge Рейтинг: https://magicseaonline.com/rating Финансовая помощь проекту: https://magicseaonline.com/donate С уважением, Magicsea Team Share this post Link to post Share on other sites
heinsenberg 0 Report post Posted December 5, 2023 I put it this way above as magicsea showed but all items turned black Quote Share this post Link to post Share on other sites
heinsenberg 0 Report post Posted December 5, 2023 function Hp_Dmg(role,dmg) local hp = Hp(role) local sp = Sp(role) if dmg <= 0 then hp = hp - dmg SetCharaAttr(hp, role, ATTR_HP) return end this is the standard 8 hours ago, heinsenberg said: I'm having problems with the energy shield, the skill is active, but when I receive attacks, HP is being hit instead of SP, can anyone help me solve this Quote Share this post Link to post Share on other sites
heinsenberg 0 Report post Posted December 5, 2023 done thanks fixed it Quote Share this post Link to post Share on other sites
heinsenberg 0 Report post Posted December 6, 2023 However, the damage from magical classes disrupted what to do? Quote Share this post Link to post Share on other sites