неизвестная ошибка

dEN5

Пользователь
10 Фев 2019
25
0
steamcommunity.com
Проект
MADNESS: PROJECT ABADDON
не знаю как решить эту ошибку , помогите !


Код:
[VScript] Script Runtime Error: ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28: GetAgility called with 2 arguments - expected 1
stack traceback:
    [C]: in function 'GetAgility'
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28>
а сам луа вот


Lua:
LinkLuaModifier("modifier_magneto_natural_order", "lua_abilities/magneto_natural_order.lua", 0)
LinkLuaModifier("modifier_magneto_natural_order_debuff", "lua_abilities/magneto_natural_order.lua", 0)

magneto_natural_order = class({GetIntrinsicModifierName = function() return "modifier_magneto_natural_order" end})
modifier_magneto_natural_order = class({
    IsHidden = function() return true end,
    IsPurgable = function() return false end,
    IsAura = function() return true end,
    GetModifierAura = function() return "modifier_magneto_natural_order_debuff" end
})

function modifier_magneto_natural_order:GetAuraSearchTeam() return self:GetAbility():GetAbilityTargetTeam() end
function modifier_magneto_natural_order:GetAuraSearchType() return self:GetAbility():GetAbilityTargetType() end
function modifier_magneto_natural_order:GetAuraSearchFlags() return self:GetAbility():GetAbilityTargetFlags() end
function modifier_magneto_natural_order:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("aura_radius") end

modifier_magneto_natural_order_debuff = class({
    IsHidden = function() return false end,
    IsPurgable = function() return false end,
    DeclareFunctions = function() return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS} end,
    GetEffectName = function() return "particles/units/heroes/hero_elder_titan/elder_titan_natural_order_physical.vpcf" end,
    GetEffectAttachType = function() return PATTACH_ABSORIGIN_FOLLOW end
})

function modifier_magneto_natural_order_debuff:OnCreated() if IsServer() then if self:GetParent():GetPhysicalArmorValue(false) > 0 then self.armor_red = self:GetParent():GetPhysicalArmorValue(false) * (self:GetAbility():GetSpecialValueFor("armor_reduction_pct") * 0.01) * -1 end end end
function modifier_magneto_natural_order_debuff:GetModifierPhysicalArmorBonus() return self.armor_red end
function modifier_magneto_natural_order_debuff:GetModifierMagicalResistanceBonus() return self:GetAbility():GetSpecialValueFor("magic_resistance_pct") * -1 end
function modifier_magneto_natural_order_debuff:OnCreated() if IsServer() then if self:GetParent():GetAgility(false) > 0 then self.as_red = self:GetParent():GetAgility(false) * (self:GetAbility():GetSpecialValueFor("as_reduction_pct") * 0.01) * -1 end end end
function modifier_magneto_natural_order_debuff:GetModifierAttackSpeedBonus_Constant() return self.as_red  end
 

dEN5

Пользователь
10 Фев 2019
25
0
steamcommunity.com
Проект
MADNESS: PROJECT ABADDON
не знаю как решить эту ошибку , помогите !


Код:
[VScript] Script Runtime Error: ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28: GetAgility called with 2 arguments - expected 1
stack traceback:
    [C]: in function 'GetAgility'
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:28>
а сам луа вот


Lua:
LinkLuaModifier("modifier_magneto_natural_order", "lua_abilities/magneto_natural_order.lua", 0)
LinkLuaModifier("modifier_magneto_natural_order_debuff", "lua_abilities/magneto_natural_order.lua", 0)

magneto_natural_order = class({GetIntrinsicModifierName = function() return "modifier_magneto_natural_order" end})
modifier_magneto_natural_order = class({
    IsHidden = function() return true end,
    IsPurgable = function() return false end,
    IsAura = function() return true end,
    GetModifierAura = function() return "modifier_magneto_natural_order_debuff" end
})

function modifier_magneto_natural_order:GetAuraSearchTeam() return self:GetAbility():GetAbilityTargetTeam() end
function modifier_magneto_natural_order:GetAuraSearchType() return self:GetAbility():GetAbilityTargetType() end
function modifier_magneto_natural_order:GetAuraSearchFlags() return self:GetAbility():GetAbilityTargetFlags() end
function modifier_magneto_natural_order:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("aura_radius") end

modifier_magneto_natural_order_debuff = class({
    IsHidden = function() return false end,
    IsPurgable = function() return false end,
    DeclareFunctions = function() return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS} end,
    GetEffectName = function() return "particles/units/heroes/hero_elder_titan/elder_titan_natural_order_physical.vpcf" end,
    GetEffectAttachType = function() return PATTACH_ABSORIGIN_FOLLOW end
})

function modifier_magneto_natural_order_debuff:OnCreated() if IsServer() then if self:GetParent():GetPhysicalArmorValue(false) > 0 then self.armor_red = self:GetParent():GetPhysicalArmorValue(false) * (self:GetAbility():GetSpecialValueFor("armor_reduction_pct") * 0.01) * -1 end end end
function modifier_magneto_natural_order_debuff:GetModifierPhysicalArmorBonus() return self.armor_red end
function modifier_magneto_natural_order_debuff:GetModifierMagicalResistanceBonus() return self:GetAbility():GetSpecialValueFor("magic_resistance_pct") * -1 end
function modifier_magneto_natural_order_debuff:OnCreated() if IsServer() then if self:GetParent():GetAgility(false) > 0 then self.as_red = self:GetParent():GetAgility(false) * (self:GetAbility():GetSpecialValueFor("as_reduction_pct") * 0.01) * -1 end end end
function modifier_magneto_natural_order_debuff:GetModifierAttackSpeedBonus_Constant() return self.as_red  end
а если уже указали на ошибку помогите так же
уменьшить ас как и броню.
 

Niker323

Пользователь
25 Сен 2018
43
27
Проект
Element Arena
Основные ошибки:
:GetAgility(false) -> :GetAgility()
две функции OnCreated
забыл дописать MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT в DeclareFunctions

Так должно работать:
Lua:
LinkLuaModifier("modifier_magneto_natural_order", "lua_abilities/magneto_natural_order.lua", 0)
LinkLuaModifier("modifier_magneto_natural_order_debuff", "lua_abilities/magneto_natural_order.lua", 0)

magneto_natural_order = class({GetIntrinsicModifierName = function() return "modifier_magneto_natural_order" end})
modifier_magneto_natural_order = class({
    IsHidden = function() return true end,
    IsPurgable = function() return false end,
    IsAura = function() return true end,
    GetModifierAura = function() return "modifier_magneto_natural_order_debuff" end
})

function modifier_magneto_natural_order:GetAuraSearchTeam() return self:GetAbility():GetAbilityTargetTeam() end
function modifier_magneto_natural_order:GetAuraSearchType() return self:GetAbility():GetAbilityTargetType() end
function modifier_magneto_natural_order:GetAuraSearchFlags() return self:GetAbility():GetAbilityTargetFlags() end
function modifier_magneto_natural_order:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("aura_radius") end

modifier_magneto_natural_order_debuff = class({
    IsHidden = function() return false end,
    IsPurgable = function() return false end,
    DeclareFunctions = function() return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS, MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT} end,
    GetEffectName = function() return "particles/units/heroes/hero_elder_titan/elder_titan_natural_order_physical.vpcf" end,
    GetEffectAttachType = function() return PATTACH_ABSORIGIN_FOLLOW end
})

function modifier_magneto_natural_order_debuff:OnCreated()
    if IsServer() then
        if self:GetParent():GetPhysicalArmorValue(false) > 0 then
            self.armor_red = self:GetParent():GetPhysicalArmorValue(false) * (self:GetAbility():GetSpecialValueFor("armor_reduction_pct") * 0.01) * -1
        end
        if self:GetParent():GetAgility() > 0 then
            self.as_red = self:GetParent():GetAgility() * (self:GetAbility():GetSpecialValueFor("as_reduction_pct") * 0.01) * -1
        end
    end
end

function modifier_magneto_natural_order_debuff:GetModifierPhysicalArmorBonus() return self.armor_red end
function modifier_magneto_natural_order_debuff:GetModifierMagicalResistanceBonus() return self:GetAbility():GetSpecialValueFor("magic_resistance_pct") * -1 end
function modifier_magneto_natural_order_debuff:GetModifierAttackSpeedBonus_Constant() return self.as_red  end
 

dEN5

Пользователь
10 Фев 2019
25
0
steamcommunity.com
Проект
MADNESS: PROJECT ABADDON
Основные ошибки:
:GetAgility(false) -> :GetAgility()
две функции OnCreated
забыл дописать MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT в DeclareFunctions

Так должно работать:
Lua:
LinkLuaModifier("modifier_magneto_natural_order", "lua_abilities/magneto_natural_order.lua", 0)
LinkLuaModifier("modifier_magneto_natural_order_debuff", "lua_abilities/magneto_natural_order.lua", 0)

magneto_natural_order = class({GetIntrinsicModifierName = function() return "modifier_magneto_natural_order" end})
modifier_magneto_natural_order = class({
    IsHidden = function() return true end,
    IsPurgable = function() return false end,
    IsAura = function() return true end,
    GetModifierAura = function() return "modifier_magneto_natural_order_debuff" end
})

function modifier_magneto_natural_order:GetAuraSearchTeam() return self:GetAbility():GetAbilityTargetTeam() end
function modifier_magneto_natural_order:GetAuraSearchType() return self:GetAbility():GetAbilityTargetType() end
function modifier_magneto_natural_order:GetAuraSearchFlags() return self:GetAbility():GetAbilityTargetFlags() end
function modifier_magneto_natural_order:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("aura_radius") end

modifier_magneto_natural_order_debuff = class({
    IsHidden = function() return false end,
    IsPurgable = function() return false end,
    DeclareFunctions = function() return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS, MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT} end,
    GetEffectName = function() return "particles/units/heroes/hero_elder_titan/elder_titan_natural_order_physical.vpcf" end,
    GetEffectAttachType = function() return PATTACH_ABSORIGIN_FOLLOW end
})

function modifier_magneto_natural_order_debuff:OnCreated()
    if IsServer() then
        if self:GetParent():GetPhysicalArmorValue(false) > 0 then
            self.armor_red = self:GetParent():GetPhysicalArmorValue(false) * (self:GetAbility():GetSpecialValueFor("armor_reduction_pct") * 0.01) * -1
        end
        if self:GetParent():GetAgility() > 0 then
            self.as_red = self:GetParent():GetAgility() * (self:GetAbility():GetSpecialValueFor("as_reduction_pct") * 0.01) * -1
        end
    end
end

function modifier_magneto_natural_order_debuff:GetModifierPhysicalArmorBonus() return self.armor_red end
function modifier_magneto_natural_order_debuff:GetModifierMagicalResistanceBonus() return self:GetAbility():GetSpecialValueFor("magic_resistance_pct") * -1 end
function modifier_magneto_natural_order_debuff:GetModifierAttackSpeedBonus_Constant() return self.as_red  end
ТЕПЕРЬ ЭТА ОШИБКА
Код:
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:25>
[VScript] Script Runtime Error: ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: attempt to call method 'GetAgility' (a nil value)
stack traceback:
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:25>
[VScript] Message count limit of 10 hit. Subsequent duplicate messages will be squelched.
 

Niker323

Пользователь
25 Сен 2018
43
27
Проект
Element Arena
ТЕПЕРЬ ЭТА ОШИБКА
Код:
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:25>
[VScript] Script Runtime Error: ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: attempt to call method 'GetAgility' (a nil value)
stack traceback:
    ...scripts\vscripts\lua_abilities\magneto_natural_order.lua:30: in function <...scripts\vscripts\lua_abilities\magneto_natural_order.lua:25>
[VScript] Message count limit of 10 hit. Subsequent duplicate messages will be squelched.
А самому подумать?

Код:
LinkLuaModifier("modifier_magneto_natural_order", "lua_abilities/magneto_natural_order.lua", 0)
LinkLuaModifier("modifier_magneto_natural_order_debuff", "lua_abilities/magneto_natural_order.lua", 0)

magneto_natural_order = class({GetIntrinsicModifierName = function() return "modifier_magneto_natural_order" end})
modifier_magneto_natural_order = class({
    IsHidden = function() return true end,
    IsPurgable = function() return false end,
    IsAura = function() return true end,
    GetModifierAura = function() return "modifier_magneto_natural_order_debuff" end
})

function modifier_magneto_natural_order:GetAuraSearchTeam() return self:GetAbility():GetAbilityTargetTeam() end
function modifier_magneto_natural_order:GetAuraSearchType() return self:GetAbility():GetAbilityTargetType() end
function modifier_magneto_natural_order:GetAuraSearchFlags() return self:GetAbility():GetAbilityTargetFlags() end
function modifier_magneto_natural_order:GetAuraRadius() return self:GetAbility():GetSpecialValueFor("aura_radius") end

modifier_magneto_natural_order_debuff = class({
    IsHidden = function() return false end,
    IsPurgable = function() return false end,
    DeclareFunctions = function() return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS, MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS, MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT} end,
    GetEffectName = function() return "particles/units/heroes/hero_elder_titan/elder_titan_natural_order_physical.vpcf" end,
    GetEffectAttachType = function() return PATTACH_ABSORIGIN_FOLLOW end
})

function modifier_magneto_natural_order_debuff:OnCreated()
    if IsServer() then
        if self:GetParent():GetPhysicalArmorValue(false) > 0 then
            self.armor_red = self:GetParent():GetPhysicalArmorValue(false) * (self:GetAbility():GetSpecialValueFor("armor_reduction_pct") * 0.01) * -1
        end
        if self:GetParent():IsHero() and self:GetParent():GetAgility() > 0 then
            self.as_red = self:GetParent():GetAgility() * (self:GetAbility():GetSpecialValueFor("as_reduction_pct") * 0.01) * -1
        end
    end
end

function modifier_magneto_natural_order_debuff:GetModifierPhysicalArmorBonus() return self.armor_red end
function modifier_magneto_natural_order_debuff:GetModifierMagicalResistanceBonus() return self:GetAbility():GetSpecialValueFor("magic_resistance_pct") * -1 end
function modifier_magneto_natural_order_debuff:GetModifierAttackSpeedBonus_Constant() return self.as_red  end
 
Реклама: