• 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] Potions

895150

New Member
Joined
Jul 16, 2007
Messages
31
Reaction score
0
Hi ive been searching around for ages trying to find how to make potions not usable in pz. I found a thread on a mana rune scripts with : canUseInPz = false. I tried adding it into data/actions/liquids/potions.lua but no luck :(


Edit: Got it working finally if anybody is wondering add this in potions.lua underneath
if(not potion) then
return false
end

if (getTileInfo(getCreaturePosition(cid)).protection) then
doPlayerSendCancel(cid, "You cannot use potions in protection zones.")
return true
end
 
Last edited:
Under:
Code:
if(not potion) then
	return false
end

Add:
Code:
if (getTileInfo(fromPosition).pz) then
	doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	return true
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = POTIONS[item.itemid]
if(not potion) then
return false
end

if (getTileInfo(fromPosition).pz) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end

Potions dont work at all now :(
 
Back
Top