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

Need help!, with this script about POtion, kekox you give me that!

leomendoza123

New Member
Joined
Oct 27, 2008
Messages
10
Reaction score
0
look that is the script
Lua:
----- Potion by Kekox
local MIN = getPlayerLevel(cid) * 21.5 / getPlayerMagicLevel(cid) * 17
local MAX = getPlayerLevel(cid) * 25.1 / getPlayerMagicLevel(cid) * 19
local EMPTY_POTION = 2264

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

function onUse(cid, item, fromPosition, itemEx, toPosition)
        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 doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
                return FALSE
        end

        doAddCondition(cid, exhaust)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
        doRemoveItem(item.uid)
        return TRUE
end
and in actions.xml... i put this:

Lua:
<action itemid="2264" event="script" value="test.lua" allowfaruse="1"/>

And this is the error


[18/09/2009 15:18:41] Lua Script Error: [Action Interface]
[18/09/2009 15:18:41] data/actions/scripts/test.lua

[18/09/2009 15:18:41] internalGetPlayerInfo(). Player not found

[18/09/2009 15:18:41] Lua Script Error: [Action Interface]
[18/09/2009 15:18:41] data/actions/scripts/test.lua

[18/09/2009 15:18:41] data/actions/scripts/test.lua:2: attempt to perform arithmetic on a boolean value
[18/09/2009 15:18:41] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/test.lua)


"If this care, i am using the last tfs"

Plx help me!
 
Last edited:
Try:
Code:
----- Potion by Kekox
local MIN = getPlayerLevel(cid) * 3 + getPlayerMagicLevel(cid) * 2
local MAX = getPlayerLevel(cid) * 2 + getPlayerMagicLevel(cid) * 1
local EMPTY_POTION = 2264

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

function onUse(cid, item, fromPosition, itemEx, toPosition)
        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 doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
                return FALSE
        end

        doAddCondition(cid, exhaust)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
        doRemoveItem(item.uid)
        return TRUE
end
 
Back
Top