• 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.X+ spell problem with storage

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 9999999) + (maglevel * 9999999.9999999) + 9999999
    local max = (level / 9999999) + (maglevel * 9999999.9999999) + 9999999
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var, isHotkey)
    if player:getStorageValue(94012) > 0 then
    return combat:execute(creature, var)
    else

    doSendMagicEffect(p,10)   
    doCreatureSay(cid, "Esta Spell Solo es para god.", TALKTYPE_ORANGE_1)
return true
end

end



shows index nil error value on line 15 on console calling value player null (the storage line)
 
Edit
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 9999999) + (maglevel * 9999999.9999999) + 9999999
    local max = (level / 9999999) + (maglevel * 9999999.9999999) + 9999999
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var, isHotkey)
    if creature:getStorageValue(94012) > 0 then
        return combat:execute(creature, var)
    else
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        creature:say("Esta Spell Solo es para god.", TALKTYPE_MONSTER_SAY)
    end
    return true
end
 
Last edited:
Back
Top