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

how do i getlevel from player?

Magictibiaman

New Member
Joined
May 25, 2009
Messages
371
Reaction score
0
i'm using a essentially a health potion and i need to call the level

to get this part of the code to work

" min = min + (level * .20)
max = max + (level * .25) "

if you read through my code you will notice that nothing is calling the level from the player

Code:
local MIN = 1000
local MAX = 1200
local EMPTY_POTION = 7634

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)


	min = min + (level * .20)
	max = max + (level * .25)

	if (max > 1200) then
		max = 1200
	end
	if (min > 1450) then
		min = 1450
	end
	

	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end


	if(getPlayerItemCount(cid, 2157) >= 1) then
			
		doPlayerRemoveItem(cid, 2157, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This action requires a gold nugget, you can buy them from the store.")
		
		return FALSE
	end
	if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end



		doAddCondition(cid, exhaust)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_RED)
		doCreatureSay(itemEx.uid, " ", TALKTYPE_ORANGE_1)



	return TRUE
end
 
Back
Top