Tenta assim:
local weaponMana = {2413, 2383}
local chanceMana = 100
local manaPorcent = 50
function onAttack(cid, target)
if not isPlayer(target) then return false end
if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) < 2 then
if isInArray(weaponMana, getPlayerSlotItem(cid, 5).itemid) or isInArray(weaponMana, getPlayerSlotItem(cid, 6).itemid) then
if (math.random(1,100) > (100 - chanceMana)) then
local mana = (getCreatureMana(target)*(manaPorcent/100))
doPlayerSendTextMessage(cid, 23, "Você sugou "..mana.." de mana do "..getCreatureName(target)..".")
doSendMagicEffect(getCreaturePosition(target), 1) -- 1 é o efeito que aparecera no target.
doCreatureAddMana(target, -(mana))
doCreatureAddMana(cid, mana)
end
end
end
return true
end
Manda a tag que você colocou aí para eu ver como tá.




info
Grupo: Marquês
Registrado: 05/12/11
Posts: 1.2k
Reputação: +173
Gênero: Masculino
script \/
local weaponMana = {2413, 2383}
local chanceMana = 100
local manaPorcent = 50
function onAttack(cid, target)
if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) < 2 then
if isInArray(weaponMana, getPlayerSlotItem(cid, 5).itemid) or isInArray(weaponMana, getPlayerSlotItem(cid, 6).itemid) then
if (math.random(1,100) > (100 - chanceMana)) then
local mana = (getCreatureMana(target)*(manaPorcent/50))
doPlayerSendTextMessage(cid, 23, "Você sugou "..mana.." de mana do "..getCreatureName(target)..".")
doSendMagicEffect(getCreaturePosition(target), 1) -- 1 é o efeito que aparecera no target.
doCreatureAddMana(target, -mana)
doCreatureAddMana(cid, mana)
end
end
end
return true
end
gente emtaum o player bate no trainer,monstros,e outros players ele nao ganha mana e nao suga mana de tals tipo gostaria que ao bater no player o tanto que hitase no player inimigo o outro que bateu ganhase de mana oque hitou e oque tomou o hit perde aquele chakra alem do hit de life no monster so batese no monster e ganhase mana
trainer a mesma coisa +rep pra quem ajudar thx por ler