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

Solved Regeneration rings that work on %

Please post the script which you're using for reference for other players searching for the same kind of solution.

Thank you.

Ooh yeah ofcourse, here's the code.

Lua:
local configs = {
  percent = 1.5, -- percent of max mana that will be added
  interval = 1*1000, -- time to add mana again
  storage = 12002
}
local function addMana(cid, interval, storage, perc)
	if(getPlayerStorageValue(cid,storage) == 1)then
		if (getCreatureMana(cid) < getCreatureMaxMana(cid)) then
			doCreatureAddMana(cid, getCreatureMaxMana(cid)/100*perc)
		end
		addEvent(addMana, interval, cid, interval,storage,perc)
	end
	return true
end
 
function onEquip(cid, item, slot)
	setPlayerStorageValue(cid,configs.storage,1)
	addEvent(addMana, 0, cid, configs.interval,configs.storage,configs.percent)
	return true
end
 
function onDeEquip(cid, item, slot)
	stopEvent(addMana)
	setPlayerStorageValue(cid,configs.storage,0)
	return false
end
 
Back
Top