• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Utura spell dont heal!

Rossii

Member
Joined
Mar 27, 2012
Messages
366
Reaction score
6
Location
England
Yo sup

i got this script V

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 20)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 3000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	local storage = 23015
	local spellname = "Recovery"
	local time = 60

        if exhaustion.check(cid, storage) == false then
                exhaustion.set(cid, storage, time)
                return doCombat(cid, combat, var)
        else
                doPlayerSendCancel(cid, "You are exhausted in " .. spellname .. " for: " ..exhaustion.get(cid, storage).." seconds.")
        end
end

but the script don't heal every couple of secs like its meant to why!
?

- - - Updated - - -

Please someone help :(
 
Try this I use it

PHP:
local config = { 
    amount = 20, -- HPs by second 
    time = 5, -- seconds 
    exhaust = { 
        storage = 1000, 
        time = 10, -- Exhaust time seconds~ 
    } 
} 

local function doRegeneration(cid, amount, seconds) 
    if seconds <= 0 then 
        return false 
    end 
    doCreatureAddHealth(cid, amount) 
    doSendAnimatedText(getThingPos(cid), "+" .. amount, COLOR_LIGHTBLUE) 
    doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
    return addEvent(doRegeneration, 1000, cid, amount, seconds - 1) 
end 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if exhaustion.check(cid, config.exhaust.storage) then         
        return doPlayerSendCancel(cid, "You're exhausted.") 
    end     
    doRemoveItem(item.uid, 1) 
    doRegeneration(cid, config.amount, config.time) 
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time) 
    return true 
end

and just edit the health a second ECT
 
Try this I use it

PHP:
local config = { 
    amount = 20, -- HPs by second 
    time = 5, -- seconds 
    exhaust = { 
        storage = 1000, 
        time = 10, -- Exhaust time seconds~ 
    } 
} 

local function doRegeneration(cid, amount, seconds) 
    if seconds <= 0 then 
        return false 
    end 
    doCreatureAddHealth(cid, amount) 
    doSendAnimatedText(getThingPos(cid), "+" .. amount, COLOR_LIGHTBLUE) 
    doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) 
    return addEvent(doRegeneration, 1000, cid, amount, seconds - 1) 
end 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if exhaustion.check(cid, config.exhaust.storage) then         
        return doPlayerSendCancel(cid, "You're exhausted.") 
    end     
    doRemoveItem(item.uid, 1) 
    doRegeneration(cid, config.amount, config.time) 
    exhaustion.set(cid, config.exhaust.storage, config.exhaust.time) 
    return true 
end

and just edit the health a second ECT

Thanks man ill try it and get back to ya
 
Back
Top