Postado Julho 23, 2018 6 anos @Navegante local skills = { [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21}, [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player} [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21}, [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21}, [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21}, [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21}, [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21}, [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21}, [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21}, } local config = { heal = true, save = true, effect = true } function onAdvance(player, skill, oldLevel, newLevel) if newLevel <= oldLevel then return true end if config.effect then local up = skills[skill] if up then player:getPosition():sendMagicEffect(up[3]) game:sendAnimatedText(player:getPosition(), up[1], up[2]) end end if config.heal then player:addHealth(player:getMaxHealth()) end if config.save then player:save() end return true end
Postado Julho 23, 2018 6 anos Autor 14 minutos atrás, Sttorm disse: @Navegante local skills = { [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21}, [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player} [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21}, [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21}, [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21}, [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21}, [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21}, [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21}, [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21}, } local config = { heal = true, save = true, effect = true } function onAdvance(player, skill, oldLevel, newLevel) if newLevel <= oldLevel then return true end if config.effect then local up = skills[skill] if up then player:getPosition():sendMagicEffect(up[3]) game:sendAnimatedText(player:getPosition(), up[1], up[2]) end end if config.heal then player:addHealth(player:getMaxHealth()) end if config.save then player:save() end return true end Olá Sttorm! Eu testei o script e deu o seguinte erro alias se possível teria como você fazer um pequeno ajuste? É que eu gostaria que a função >>>> player:addHealth(player:getMaxHealth()) <<<<< funcionasse somente quando o player subisse de level.
Postado Julho 23, 2018 6 anos @Navegante local skills = { [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21}, [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player} [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21}, [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21}, [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21}, [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21}, [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21}, [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21}, [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21}, } local config = { heal = true, save = true, effect = true } function onAdvance(player, skill, oldLevel, newLevel) if newLevel <= oldLevel then return true end if config.effect then local up = skills[skill] if up then player:getPosition():sendMagicEffect(up[3]) doSendAnimatedText(player:getPosition(), up[1], up[2]) end end if config.heal and skill == 8 then player:addHealth(player:getMaxHealth()) end if config.save then player:save() end return true end
Postado Julho 23, 2018 6 anos Autor Solução Script atualizado: local skills = { [0] = {"Fist up!", 29}, [1] = {"Club up!", 29}, -- [SKILL_ID] = {"ANIMATED TEXT", effect no player} [2] = {"Sword up!", 29}, [3] = {"Axe up!", 29}, [4] = {"Dist up!", 29}, [5] = {"Shield up!", 29}, [6] = {"Fish up!", 29}, [7] = {"Magic up!", 31}, [8] = {"Level up!", 30}, } local config = { heal = true, save = true, effect = true } function onAdvance(player, skill, oldLevel, newLevel) if newLevel <= oldLevel then return true end if config.effect then local up = skills[skill] if up then player:say(up[1], TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(up[2]) end end if config.heal and skill == 8 then player:addHealth(player:getMaxHealth()) end if config.save then player:save() end return true end Crédito: Sttorm Participação: tataboy 67 muito obrigado pela ajuda de ambos!!! Editado Julho 23, 2018 6 anos por Navegante (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.