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

item On use to have a constent Healing affect for period of time

Angel Of Death

Rise Of Tibia ServerOwner
Joined
Mar 12, 2012
Messages
91
Reaction score
0
Alright i have no clue how to do it but i need an item after use to heal for 10 - 20 mins
and also make the player drunk for 10 - 20 mins aswell

- - - Updated - - -

can some one please help me
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local exh = {
		storage = 1000, 
		time = 1200
	}
	
	local timePerHeal = 1000
	local healExpires = 1200
	local amountP = 30
	
	local function exHeal (cid, amount, i)
		while i > 0 then
			doCreatureAddHealth(cid, amount)
			addEvent(exHeal, timePerHeal, amount)
			i = i - 1
		end
		return true
	end
	
	if(exhaustion.check(cid, exh.storage) == false) then
		exHeal(cid, amountP, healExpires)
		exhaustion.set(cid, exh.storage, exh.time)
                doRemoveItem(item.uid, 1)
	else	
		doPlayerSendCancel(cid, "You have to wait ".. exhaustion.get(cid, exh.storage) .." seconds to do it again.")
	end
	return true
end

Noooo idea if this works.. just did soemthing :/
 
Back
Top