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

GetCorpseName [help]

delton

New Member
Joined
Jun 13, 2008
Messages
230
Reaction score
0
Location
Ijuí
Please, i need help for create a variable for get corpse name!

My Example is:
Code:
if isCorpse(itemEx.uid) then
local cn =  string.find(getItemName(itemEx.uid), "dead (%a+)")

HELP Please!!!
 
dead %a. -> any letter "%a." "%a" for letters and "." for any name...

so? he does not need it.

Lua:
    local name = getItemName(itemEx.uid):lower()
    
    name = name:sub(name:find('dead') + 5, name:len())

its like obviously why he want this ... anyone guess? A_A
 
Code:
	if isCorpse(itemEx.uid) then
		local name = getItemInfo(itemEx.itemid).name
		local b, e = name:find('dead ')
		if e then
			name = name:sub(e+1)
		end
 
Hiho, i need help in this part:

Code:
elseif item.itemid == TYPE_PB_FREE_POKE then -- Free Poke
		  if isCorpse(itemEx.uid) then
		--  local name = getItemName(itemEx.uid):lower()
			--name = name:sub(name:find('dead') + 5, name:len())
		  --isMonster(itemEx.uid)
	
			local name = getItemInfo(itemEx.itemid).name
			local b, e = name:find('dead ')
			if e then
				name = name:sub(e+1)
			end

			--local a, b, cn = getItemDescriptionsById(itemEx.itemid).name; 
			 --local a, b, cn =  string.find(getItemName(itemEx.uid), "dead (%a+)")
			 --local corpsen = string.len(tostring(corpseName2)) > 0 and tostring(corpseName2) or string.len(tostring(corpseName1)) > 0 and tostring(corpseName1) or " "
			 local chance = tonumber(CHANCE_TO_CAPTURE)
			 local outpoint = CHANCE_TO_CAPTURE
			 string.gsub(outpoint, ".", "")
			  if math.random(1,(10 ^ string.len(outpoint))*100) <= (((10 ^ string.len(outpoint)) * 100) * chance) then
				 doSendMagicEffect(toPosition, 24)
				 --doItemSetAttribute(item.uid, "description", "It contains a " .. name .. ".")
				 doSetItemAttr(item.uid, "specialdescr", "It contains a " .. b .. ".")
				 --doSetItemSpecialDescription(item.uid, )
				 doTransformItem(item.uid, TYPE_PB_OUT_POKE)
				 doSendMagicEffect(getThingPos(cid), 28)
				 doRemoveItem(itemEx.uid)
				 doPlayerRemoveItem(cid, 2149, 1)
			  else
				 doSendMagicEffect(toPosition, 23)
				 doRemoveItem(itemEx.uid)
				 doPlayerRemoveItem(cid, item.itemid, 1)
			  end	
			end

Have some erros in set item attribute... I created new function in sources but the script don't work!


Who Can Help me? :thumbup:
 
Back
Top