• 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!

Mana Heal Square?

Lua:
function onStepIn(cid, item, position, fromPosition)

  doPlayerAddMana(cid, (getCreatureMaxMana - getPlayerMana))
  doSendMagicEffect(topos, 14)
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mana healed.")
  return TRUE

end
 
What?, only set the uniqueid 2020 in your map and here:


Movements.xml
PHP:
<movevent type="StepIn" uniqueid="2020" script="mana.lua"/>
 
Yea, but nothing like that. Like this,

Code:
local config = {

        healHP = 1000000,
        healPlayers = "yes",
        healMonsters = "yes",
}

local healthArea = {

        fromX = 999,
        fromY = 1002,
        fromZ = 7,
        toX = 999,
        toY = 1002,
        toZ = 7,

}

function onThink(cid, interval, lastExecution)
        for x = healthArea.fromX, healthArea.toX do
                for y = healthArea.fromY, healthArea.toY do
                        for z = healthArea.fromZ, healthArea.toZ do
                                local pos = {x=x, y=y, z=z, stackpos = 253}
                                local thing = getThingfromPos(pos)
                                doSendMagicEffect(pos, 29)
                                if thing.itemid > 0 then
                                        if(isPlayer(thing.uid) == TRUE and string.lower(config.healPlayers) == "yes") then
                                                doCreatureAddHealth(thing.uid, config.healHP)
                                                if string.lower(getConfigValue("showHealingDamage")) == "no" then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 19)
                                                end
                                        elseif(isMonster(thing.uid) == TRUE and string.lower(config.healMonsters) == "yes") then
                                                doCreatureAddHealth(thing.uid, config.healHP)
                                                if string.lower(getConfigValue("showHealingDamageForMonsters")) == "no" then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 19)
                                                end
                                        end
                                end
                        end
                end
        end
        return TRUE
end


But thats the health one.
 
Lol mate, the next time explain yourself better and post the script, anyway here is it.


Lua:
local config = {

        healMana = 1000000,

}

local healthMana = {

        fromX = 999,
        fromY = 1002,
        fromZ = 7,
        toX = 999,
        toY = 1002,
        toZ = 7,

}

function onThink(cid, interval, lastExecution)
        for x = healthMana.fromX, healthMana.toX do
                for y = healthMana.fromY, healthMana.toY do
                        for z = healthMana.fromZ, healthMana.toZ do
                                local pos = {x=x, y=y, z=z, stackpos = 253}
                                local thing = getThingfromPos(pos)
                                doSendMagicEffect(pos, 29)
                                if thing.itemid > 0 then
                                        if(isPlayer(thing.uid) == TRUE) then
                                                doPlayerAddMana(thing.uid, config.healMana)
                                                if string.lower(getConfigValue("showHealingDamage")) == "no" then
                                                        doSendAnimatedText(pos, "+"..config.healMana.."", 19)
                                                end

                                end
                        end
                end
        end
        return TRUE
end


:thumbup:
 
Back
Top