please could someone help me with this script tou with this error use The OTX server version: (2.12)
Code:
local t = {
storage = 689678, -- storage, so mude se tiver usando pra outra coisa.
tempo = 300 --
}
local config = {
pos = {x=getCreaturePos(cid), y=getCreaturePos(cid), z=getCreaturePos(cid)}, -- posição da aegis dimension
tempo = 1, -- tempo pra voltar
effect1 = 30, -- efeito ao morrer
effect2 = 30, -- efeito ao retornar a vida
storage = 19332
}
---local vocs = 111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,475}
local vocs = {111-126,475}
function onStatsChange(cid, attacker, type, combat, value)
if(not(isInArray(vocs, getPlayerVocation(cid)))) then
end
if getPlayerStorageValue(cid, t.storage) < os.time() then
if type == STATSCHANGE_HEALTHLOSS and value >= getCreatureHealth(cid) then
setPlayerStorageValue(cid, t.storage, os.time() + t.tempo)
doCreatureSay(cid, "REVIVE!", 19)
--if getPlayerStorageValue(cid, config.storage) > 0 then
--if getPlayerVocation(cid) == vocs then
--doPlayerSetStorageValue(cid, config.storage, (getPlayerStorageValue(cid, config.storage)-1))
addEvent(doTeleportThing, 1000*config.tempo, cid, getThingPos(cid), true)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(cid), config.effect2)
doSendMagicEffect(getThingPos(cid), config.effect1)
--doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
--doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doCreatureAddHealth(cid, (35*getCreatureMaxHealth(cid))/100)
doCreatureAddMana(cid, (35*getCreatureMaxMana(cid))/100)
doTeleportThing(cid, config.pos)
if isCreature(attacker) then
doPlayerSendTextMessage(cid, 27, "Passiva Ativada - Recarga 300 Segundos")
end
if isPlayer(attacker) and isCreature(cid) then
--doPlayerSendTextMessage(attacker, 27, "You killed ".. getCreatureName(cid) .."!")
end
for i = 1,config.tempo do
addEvent(function()
if isCreature(cid) then
doPlayerSendTextMessage(cid,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)")
end
end, 1000*i)
end
return false
end
end
return true
end
Last edited by a moderator: