O certo é sem o local function.. assim
local temp = {
exhausted = 2,
storage = 100
}
local confg = {
mp = 10
}
function removemana(cid)
doPlayerAddMana(cid, -10)
end
function onCastSpell(cid, var)
if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, 24, "you are exhausted, wait " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 1 and "" or "s"))
return false
end
if getPlayerMana(cid) >= confg.mp then
local min = (getPlayerLevel(cid) + getPlayerSkill(cid, SKILL_MAGLEVEL)*0.4)
local max = (getPlayerLevel(cid) + getPlayerSkill(cid, SKILL_MAGLEVEL)*0.5)
local target = getCreatureTarget(cid)
if getCreatureOutfit(cid).lookType == 128 then
actionMove(cid, 352, 800)
end
FireEffect(cid)
noMove(cid, 800)
removemana(cid)
addEvent(doSendAnimatedText, 200, getThingPos(cid), "Fire:", COLOR_RED)
addEvent(doSendAnimatedText, 600, getThingPos(cid), "BLAST !", COLOR_RED)
addEvent(doTargetCombatHealth, 900, cid, target, COMBAT_FIREDAMAGE, -min, -max, 6)
addEvent(doSendDistanceShoot, 900, getCreaturePosition(cid), getThingPos(target), 3)
setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)
else
doPlayerSendCancel(cid, "you do not have mana.")
end
end







info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36
estou usando return false em spell pra poder usa doAnimatedText, ai resolvi usar doPlayerAddMana pra remover a mana do player, mas a função não executa
o script está assim
Editado Outubro 20 por craigmabbit