Jump to content

Recommended Posts

I create Dark Souls Characters mod and pot items DS to DST, but in DST it not work and i don't know why

Sacredoath item work in DS

log:

Spoiler

 [string "../mods/test-cleric/scripts/prefabs/sacredo..."]:64: attempt to index local 'fx' (a nil value)
LUA ERROR stack traceback:
    ../mods/test-cleric/scripts/prefabs/sacredoath.lua:64 in (field) onheard (Lua) <51-89>
    scripts/components/instrument.lua:25 in () ? (Lua) <16-30>

code of item:

Spoiler

local function buffAll(who, doer, inst)
    --Увеличение атаки 10-15%, реген 1 хп в сек, резист к нег аурам 30%
    local buffexpire = 240
    local range = 30
    local pos = Vector3(doer.Transform:GetWorldPosition())
    local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range)
    for k,v in pairs(ents) do
        if v:HasTag("player") and v.components.health and not v.components.health:IsDead() then
            print (v)
            --Если впервые используем, то бафаем, иначе удаляем таск и создаем заново
            if not v.task then
                --Накладываем баф
                local fx = SpawnPrefab("glow")
 64-->       fx.entity:SetParent(v.entity)
                fx.Transform:SetPosition(0, 0.1, 0)
                fx.Transform:SetScale(0.75, 0.75, 0.75)
               
                buffAttack(v, true)
                buffHpReg(v, true)
                buffNegAuraRes(v, true)
            else
                v.task:Cancel()
                v.task=nil
            end
            v.components.talker:Say("My power is over nine thousand!")
            v.task = v:DoTaskInTime(buffexpire, function()
                -- Убираем баф
                if (fx) then fx.dissapear(fx) end
                buffAttack(v, false)
                buffHpReg(v, false)
                buffNegAuraRes(v, false)
                v.task:Cancel()
                v.task=nil
            end)
        end
    end
   
    return true
end

 

sacredoath.lua

server_log.txt

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...