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

[HELP ME] Potions

Lopaz

Member
Joined
Sep 1, 2010
Messages
50
Reaction score
5
Location
https://otland.net/
Hello... I need help with a potion script.

When I use a mana potion (the smallest one), I want it to disappear without leaving empty vials afterwards.
I tried to rescript it or so but it doesn't work.

I want it just like my great mana potion. When I use it, the used potion disappears without leaving any traces.
Help please, i'm still pretty new at this ^^

Code:
          	doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
	        doRemoveItem(item.uid, EMPTY_POTION)
		doPlayerAddItem(cid, emptyPot, 0)
		doRemoveItem(item.uid, 1)
	        elseif(item.itemid == manaPot) then
		if(doTargetCombatMana(0, cid, 200, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end

Can someone see the problem?
 
Try removing this line
doPlayerAddItem(cid, emptyPot, 0)

like this:
Lua:
doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
	        doRemoveItem(item.uid, EMPTY_POTION)
		doRemoveItem(item.uid, 1)
	        elseif(item.itemid == manaPot) then
		if(doTargetCombatMana(0, cid, 200, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
 
Try removing this line
doPlayerAddItem(cid, emptyPot, 0)

like this:
Lua:
doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
	        doRemoveItem(item.uid, EMPTY_POTION)
		doRemoveItem(item.uid, 1)
	        elseif(item.itemid == manaPot) then
		if(doTargetCombatMana(0, cid, 200, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end



God damnit did I really miss that line? Thanks for your little effort :D + to you!
 
Back
Top