PHP:local config = { centerPos = {x = 99, y = 133, z = 7}, xRadius = 7, yRadius 5, healthValue = 20, textColor = 18 -- green } function onThink(cid, interval, lastExecution) for _, v in pairs(getSpectators(config.centerPos, config.xRadius, config.yRadius)) do doSendMagicEffect(v, CONST_ME_MAGIC_BLUE) local thing = getThingFromPos(v) if (isPlayer(thing.uid) == TRUE) then doCreatureAddHealth(thing.uid, config.healthValue) doSendAnimatedText(positions[1], "+" .. config.healthValue, config.textColor) end end return TRUE end
Better version
I doubt getSpectators returns a position
Though, my version of this code was using doAreaCombatHealth and imo most efficient...
I gave it to Pitufo but never saved it, thought he'd update his post here o.o