• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Heal Problem

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Hello
I have a little problem.
Pic. and im using 3.6
https://i.imgur.com/scoumEd.png

LUA:
  --[[
        Idea by Pitufo
        Script by Shawak
]]--

local config = {

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

local healthArea = {

        fromX = 1001,
        fromY = 995,
        fromZ = 7,
        toX = 1009,
        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, 12)
                                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")) == "yes" then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 18)
                                                end
                                        elseif(isMonster(thing.uid) == TRUE and string.lower(config.healMonsters) == "yes") then
                                                doCreatureAddHealth(thing.uid, config.healHP)
                                                if string.lower(getConfigValue("showHealingDamageForMonsters")) == "yes" then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 18)
                                                end
                                        end
                                end
                        end
                end
        end
        return TRUE
end

Rep++
 
Code:
 --[[
        Idea by Pitufo
        Script by Shawak
]]--
 
local config = {
 
        healHP = 1000,
        healPlayers = "yes",
        healMonsters = "yes",
}
 
local healthArea = {
 
        fromX = 1001,
        fromY = 995,
        fromZ = 7,
        toX = 1009,
        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, 12)
                                if thing.itemid > 0 then
                                        if(isPlayer(thing.uid) == TRUE and string.lower(config.healPlayers) == "yes") then
                                                doCreatureAddHealth(thing.uid, config.healHP)
                                                if getConfigValue("showHealingDamage") == true then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 18)
                                                end
                                        elseif(isMonster(thing.uid) == TRUE and string.lower(config.healMonsters) == "yes") then
                                                doCreatureAddHealth(thing.uid, config.healHP)
                                                if getConfigValue("showHealingDamageForMonsters") == true then
                                                        doSendAnimatedText(pos, "+"..config.healHP.."", 18)
                                                end
                                        end
                                end
                        end
                end
        end
        return TRUE
end

Try this.
 
Back
Top