Postado Agosto 24, 2014 10 anos elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not target then return false end if getPlayerStorageValue(cid, 498587) == 1 then local life = getCreatureHealth(target) local newlife = life - getCreatureHealth(target) doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14) doSendMagicEffect(getThingPosWithDebug(cid), 12) doSendMagicEffect(getThingPosWithDebug(target), 45) if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32) end end end, 1000*var) end
Postado Agosto 24, 2014 10 anos Autor Fica aparecendo attempt to perform arithmetic on local 'life' (a boolean value) Quando o target morre. Aparece no log o numero de vezes que falta pra terminar o for.
Postado Agosto 24, 2014 10 anos elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not isCreature(target) or not isCreature(cid) then return false end if getPlayerStorageValue(cid, 498587) == 1 then local life = getCreatureHealth(target) doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14) doSendMagicEffect(getThingPosWithDebug(cid), 12) doSendMagicEffect(getThingPosWithDebug(target), 45) local newlife = life - getCreatureHealth(target) if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32) end end end, 1000*var) end
Postado Agosto 24, 2014 10 anos Bom... Se não for agora, vou passar ter que deixar outra pessoa resolver. elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not isCreature(target) or not isCreature(cid) then return false end if getPlayerStorageValue(cid, 498587) == 1 then local life = getCreatureHealth(target) doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1) doSendMagicEffect(getThingPosWithDebug(cid), 12) doSendMagicEffect(getThingPosWithDebug(target), 45) doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14) local newlife = isCreature(target) and (life - getCreatureHealth(target)) or 0 if newlife >= 1 then doCreatureAddHealth(cid, newlife) doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32) end end end, 1000*var) end
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.