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

Heal zone 0.4

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
can some make so u set cod for X and Y and in that zone u get healed and heal effect?
 
It is for 0.3.6 but it should work on 0.4
LUA:
function onThink(cid, interval, lastExecution)
	for areax = 994, 1004 do -- manage this
		for areay = 993, 1004 do -- and this
		area = {x=areax, y=areay, z=7, stackpos=253} 
		pl = getThingFromPos(area)
			if pl.itemid >= 1 then
				if getCreatureHealth(pl.uid) ~= getCreatureMaxHealth(pl.uid) and getPlayerAccess(pl.uid) <= 2  then
				pos = getCreaturePosition(pl.uid)
				doCreatureAddHealth(pl.uid, math.random(100,300)) -- and this
				doSendMagicEffect(pos, 12)
				end
			end
		end
	end
	return true
end
 
little edit :p
Code:
function onThink(interval, lastExecution)
	for areax = 994, 1004 do
		for areay = 993, 1004 do
			local v = getTopCreature({x=areax, y=areay, z=7}).uid
			if isPlayer(v) and getCreatureHealth(v) < getCreatureMaxHealth(v) and getPlayerAccess(v) < 3 then
				doCreatureAddHealth(v, math.random(100, 300))
				doSendMagicEffect(getThingPos(v), CONST_ME_MAGIC_BLUE)
			end
		end
	end
	return true
end
 
Back
Top