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

TFS 1.0 getplayerrequiredmana function

Tropix

Like a BAuZZ
Joined
Jan 6, 2009
Messages
116
Reaction score
4
TFS 1.0
Where can i add this function
Lua:
function doPlayerAddMagLevel(cid, amount)
    for i = 1, amount do
        doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid), false)
    end

return true
end

Lua Script Error: [Action Interface]
data/actions/scripts/scrolls.lua:eek:nUse
data/actions/scripts/scrolls.lua:61: attempt to call global 'getPlayerRequiredMana' (a nil value)
 
The function getPlayerRequiredMana do not exist.

The function you're looking for is called getRequiredManaSpent, take a look here:
https://github.com/otland/forgotten...5c/data/talkactions/scripts/add_skill.lua#L58

It doesnt work


Feb 10 16:44:21 176-31-89-141 tfs[3322]: Lua Script Error: [Action Interface]
Feb 10 16:44:21 176-31-89-141 tfs[3322]: data/actions/scripts/scrolls.lua:eek:nUse
Feb 10 16:44:21 176-31-89-141 tfs[3322]: data/actions/scripts/scrolls.lua:62: attempt to call global 'getRequiredManaSpent' (a nil value)


doPlayerAddSpentMana(cid, math.ceil(math.min((getRequiredManaSpent(cid, limit) - getPlayerSpentMana(cid)), v.mana)))
 
Back
Top