@skailord, você não pode dar up no tópico dos outros a não ser que tenha passado 24 hrs. Leia as regras
spells\scripts\especiais\invencible.lua
local config = {
storage = 3482101,
cooldown = 30, --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29 -- efeito que sai ao falar a spell
}
local outfit = createConditionObject(CONDITION_INVISIBLE, config.duration * 1000, false)
function onCastSpell(cid, var)
if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), config.effect1)
setPlayerStorageValue(cid, config.storage, os.time() + config.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
doPlayerSendTextMessage(cid, 27, "You have now ".. config.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end
return true
end
spells.xml
<instant name="testeTK" words="naruto3" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/invencible.lua">
</instant>
creaturescripts\scripts\login.lua:
---------- Invencible ----------------
registerCreatureEvent(cid, "invencible")
if getPlayerStorageValue(cid, 3482101) ~= 0 then
setPlayerStorageValue(cid, 3482101, 0)
end
creaturescripts.xml:
<event type="statschange" name="invencible" event="script" value="invencible.lua"/>
creaturescripts\scripts\invencible.lua
local config = {
storage = 3482101,
effect1 = 2 --- efeito ao ser atacado estando invulnerável
}
function onStatsChange(cid, attacker, type, combat, value)
if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then
if getPlayerStorageValue(cid,config.storage) - os.time() > 0 and isCreature(attacker) then
doSendMagicEffect(getCreaturePosition(cid), config.effect1)
doSendAnimatedText(getCreaturePosition(cid), "0", 180)
return false
end
end
return true
end
Usei o mesmo storage da outra spell que fiz pra vc uchihagaeshi, mude o storage em todos os scripts ;]