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

Lua Mana / Health Potions

Deaktiver

Materia
Joined
Nov 25, 2007
Messages
637
Reaction score
4
Location
Germany
Hello!

Can I make or change something in a File that the Mana Potions and Health Potions dissapear after using? Because the Players are throwning it on the floor and that sux. Is there a Script? I saw it on a other OTS.
 
Ehm..how to change? I tryed it but it does not work heres the script:

local greatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

function onUse(cid, item, frompos, item2, topos)
if(item.itemid == healthPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == manaPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 80, 150, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == strongHealthPot) then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
if getPlayerLevel(cid) > 50 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 350, 450, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == strongManaPot) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
if getPlayerLevel(cid) > 50 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 150, 250, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == greatHealthPot) then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
if getPlayerLevel(cid) > 80 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 550, 650, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == greatManaPot) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
if getPlayerLevel(cid) > 80 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 250, 350, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
end

return TRUE
end
 
Last edited:
Change doTransformItem(item.uid, emptyPot) this to that doRemoveItem(item.uid), if wont work then doRemoveItem(item.uid, 1)
 
Back
Top