Postado Março 21, 2018 7 anos Fala, galera! Então, eu tenho um script aqui de Life Steal, porém, ele só funciona em players... e eu queria que ele funcionasse em monstros também! Teria como? Spoiler local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if not isPlayer(attacker) then return true end if not isInArray(config.vocations, getPlayerVocation(attacker)) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end
Postado Março 21, 2018 7 anos local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(attacker) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end Editado Março 21, 2018 7 anos por Way20 (veja o histórico de edições) Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Março 21, 2018 7 anos Autor 17 minutos atrás, Way20 disse: local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(attacker) then return true end if not isInArray(config.vocations, getPlayerVocation(attacker)) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end deu esse erro: [20:45:51.047] [Error - CreatureScript Interface] [20:45:51.050] data/creaturescripts/scripts/lifesteal.lua:onStatsChange [20:45:51.054] Description: [20:45:51.056] (LuaInterface::internalGetPlayerInfo) Player not found when requesting player info #6
Postado Março 21, 2018 7 anos 1 minuto atrás, Yamborghini disse: deu esse erro: [20:45:51.047] [Error - CreatureScript Interface] [20:45:51.050] data/creaturescripts/scripts/lifesteal.lua:onStatsChange [20:45:51.054] Description: [20:45:51.056] (LuaInterface::internalGetPlayerInfo) Player not found when requesting player info #6 Tinha esquecido uma coisa. local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(attacker) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end 5 minutos atrás, Yamborghini disse: deu esse erro: [20:45:51.047] [Error - CreatureScript Interface] [20:45:51.050] data/creaturescripts/scripts/lifesteal.lua:onStatsChange [20:45:51.054] Description: [20:45:51.056] (LuaInterface::internalGetPlayerInfo) Player not found when requesting player info #6 Acabei postando o mesmo código sem a edição que fiz. Editei o post agora, tenta novamente. Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Março 21, 2018 7 anos Autor 7 minutos atrás, Way20 disse: Tinha esquecido uma coisa. local config = { weapons = { -- [ID] = LIFE STEAL %, [8602] = 10, }, -- Vocations number -- 1, 5 = Druid, Elder Druid -- 2, 6 = Sorcerer, Master Sorcerer -- 3, 7 = Paladin, Royal Paladin -- 4, 8 = Knight, Elite Knight -- others vocations = {4, 8}, } function onLogin(cid) registerCreatureEvent(cid, "LifeSteal") return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(attacker) then return true end for slot = 0, 9 do for id, perc in pairs(config.weapons) do if (getPlayerSlotItem(attacker, slot).id == id) then return doCreatureAddHealth(attacker, math.ceil(value / perc)) end end end return true end Acabei postando o mesmo código sem a edição que fiz. Editei o post agora, tenta novamente. acontece nada, o player nao heala vida @Absolute
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.