Lbtg
Advanced OT User
- Joined
- Nov 22, 2008
- Messages
- 2,398
- Reaction score
- 165
Hey so i found this script to heal area place but it has some error. i use 0.4 can someone please help fixing it ?
but i get error if monster or player is on area of heal
error
PHP:
--[[
Idea by Pitufo
Script by Shawak
]]--
local config = {
healHP = 10000,
healPlayers = "yes",
healMonsters = "yes",
}
local healthArea = {
fromX = 1002,
fromY = 997,
fromZ = 5,
toX = 1004,
toY = 999,
toZ = 5,
}
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, 1)
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
but i get error if monster or player is on area of heal
error
Code:
[18:17:24.249] [Error - GlobalEvent Interface]
[18:17:24.249] data/globalevents/scripts/healplace.lua:onThink
[18:17:24.249] Description:
[18:17:24.249] data/globalevents/scripts/healplace.lua:34: bad argument #1 to 'lower' (string expected, got boolean)
[18:17:24.249] stack traceback:
[18:17:24.249] [C]: in function 'lower'
[18:17:24.249] data/globalevents/scripts/healplace.lua:34: in function <data/globalevents/scripts/healplace.lua:24>
[18:17:24.249] [Error - GlobalEvents::think] Couldn't execute event: healspot
