• 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+ PROBLEM WITH SPELL SCRIPT

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
HI MY PROBLEM IS I MAKE THIS SPELL AND IT WORKS FINE, BUT WHEN IM TRY TO ADD A STORAGE, IT DOESNT NOT WORK, AND SHOW NO ERROR ON CONSOLE, PLEASE HELP ME


Lua:
-- Areas/Combat for 0ms
local combat0_Brush_5 = createCombatObject()
setCombatParam(combat0_Brush_5, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat0_Brush_5, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat0_Brush_5, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat0_Brush_5, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat0_Brush_5,createCombatArea({{3}}))
function getDmg_Brush_5(cid, level, maglevel)
    return (999999999)*-1,(999999999)*-1
end
setCombatCallback(combat0_Brush_5, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_5")

-- Areas/Combat for 400ms
local combat4_Brush_3 = createCombatObject()
setCombatParam(combat4_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
setCombatParam(combat4_Brush_3, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat4_Brush_3, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat4_Brush_3, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat4_Brush_3,createCombatArea({{3}}))
function getDmg_Brush_3(cid, level, maglevel)
    return (999999999)*-1,(999999999)*-1
end
setCombatCallback(combat4_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3")

-- Areas/Combat for 200ms
local combat2_Brush_4 = createCombatObject()
setCombatParam(combat2_Brush_4, COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS)
setCombatParam(combat2_Brush_4, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
setCombatParam(combat2_Brush_4, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat2_Brush_4, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat2_Brush_4,createCombatArea({{3}}))
function getDmg_Brush_4(cid, level, maglevel)
    return (999999999)*-1,(999999999)*-1
end
setCombatCallback(combat2_Brush_4, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_4")

-- Areas/Combat for 600ms
local combat6_Brush_2 = createCombatObject()
setCombatParam(combat6_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat6_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat6_Brush_2, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat6_Brush_2, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat6_Brush_2,createCombatArea({{3}}))
function getDmg_Brush_2(cid, level, maglevel)
    return (999999999)*-1,(999999999)*-1
end
setCombatCallback(combat6_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")

-- Areas/Combat for 800ms
local combat8_Brush_2 = createCombatObject()
setCombatParam(combat8_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY)
setCombatParam(combat8_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat8_Brush_2, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat8_Brush_2, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat8_Brush_2,createCombatArea({{3}}))
function getDmg_Brush_2(cid, level, maglevel)
    return (999999999)*-1,(999999999)*-1
end
setCombatCallback(combat8_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
    if (isCreature(cid)) then
        doCombat(cid, c, var)
    
        if (dirList ~= nil) then -- Emit distance effects
            local i = 2;
            while (i < #dirList) do
                doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
                i = i + 2
            end       
        end
    end
end

function onCastSpell(cid, var)
if creature:getStorageValue(94012) = 1 then
    local startPos = getCreaturePosition(cid)
    RunPart(combat0_Brush_5,cid,var)
    addEvent(RunPart,400,combat4_Brush_3,cid,var)
    addEvent(RunPart,200,combat2_Brush_4,cid,var)
    addEvent(RunPart,600,combat6_Brush_2,cid,var)
    addEvent(RunPart,800,combat8_Brush_2,cid,var)
    return true
end
 
you did an assignment instead of comparison

change (line 77)
Lua:
if creature:getStorageValue(94012) = 1 then
to
Lua:
if creature:getStorageValue(94012) == 1 then
 
is this the whole script? you're also lacking an end in the end, because you opened a function and an if, but only closed one of them
does it not give you an error?

the other thing I'd say is does creature exist in this context? I don't see its declaration anywhere. is it a global?
 
Back
Top