• 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+ Error "Argument #3 is unsafe" in Spells (Addevents)

Fabi Marzan

Well-Known Member
Joined
Aug 31, 2020
Messages
135
Solutions
6
Reaction score
66
Use: TFS 1.X (1.3)
Very well, I have a problem with a spell that when I execute it I get the following error:

Screenshot_55.png

The scripts that I use:
Lua:
local combatOne = createCombatObject()
setCombatParam(combatOne, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combatOne, COMBAT_FORMULA_LEVELMAGIC, -1.0, -150, -1.0, -160)

local function Test(cid, target)
    if isCreature(cid) then
        if isCreature(target) then
        local pos = getCreaturePosition(target)
        addEvent(doSendMagicEffect, 0, {x = pos.x+1, y = pos.y, z = pos.z}, 15)
            return true
        end
    end
    return true
end

function onCastSpell(cid, var)
local parameters = {cid = cid, var = var, combatOne = combatOne}
---addEvent(onCastSpellOne, 100, parameters)
        local config = {
                hit = 1, -- Veces que dara un hit.
                time = 100, -- tiempo que saldra la magia.
                configtarget = getCreatureTarget(cid), --- No borre (es importante para que salga las magias).
        }
         for a = 1, config.hit do
                addEvent(Test, config.time * a, cid, config.configtarget)  
        end  
return doCombat(cid, combatOne, var)
end

I've been trying and trying and it's on the line:
Code:
addEvent(Test, config.time * a, cid, config.configtarget)
It is where I get the error, on the contrary, when I eliminate it, it no longer happens to me. Any solution? I would really appreciate it.
 
Back
Top