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

[Request] Health Rune

Aklovo

Enjoy It
Joined
Dec 30, 2009
Messages
453
Reaction score
12
Location
México
Hi, im looking for a health rune, wich health exactly the same like the ultimate healing potion and just can be used by knights and infinite. o.0 Can anyone help me plx?

Mm another request D:, anyone have idea how to do when a char lvl 50- die got teleport to temple, but without losing nothing? Kind of protection level, but i want this cuze the low chars is always blocking the paths, Thx!
 
Code:
local cfg = {
	min = 700,
	max = 1000,
	lvl = 130,
	voc = { 4,8 }
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local add = math.random(cfg.min, cfg.max)
	if(getPlayerLevel(cid) >= cfg.lvl) then
		if(isInArray(cfg.voc, getPlayerVocation(cid))) then
			doCreatureAddHealth(cid, add)
		else
			doCreatureSay(cid, "Only Knight's or Elite Knight's can use this rune.", TALKTYPE_ORANGE_1)
		end
	else
		doCreatureSay(cid, "Only players of level " .. cfg.lvl .. " or higher can use this rune.", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Last edited:
  1. Static variables before function
  2. Don't use () around conditional statements, this is not C++/Java(-Script)/PHP/whatever
  3. He wanted it to be infinite
  4. Should be usable on other players

Code:
local cfg = {
	min = 700,
	max = 1000,
	lvl = 130,
	voc = {4, 8}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) and isInArray(cfg.voc, getPlayerVocation(cid)) and getPlayerLevel(cid) >= cfg.lvl then
		doCreatureAddHealth(itemEx.uid, math.random(cfg.min, cfg.max))
	else
		doCreatureSay(cid, "Only knights of level " .. cfg.lvl .. " or higher may use this rune.", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Back
Top