Jump to content

Need help with crash


Recommended Posts

I've got a mod, that adds new amulet. But I have some troubly with it. When I exit game, it crashes witn

16: attempt to index field 'combat' (a nil value)

And I no longer able to start server. I realy can't understand why is it crashing... 

My prefab is here:

I realy need your help. Thank you for taking your time to solve my problem! :)

Edited by makar5000
  • Like 1
Link to comment
Share on other sites

@makar5000

local function onequip(inst, owner)
   owner.AnimState:OverrideSymbol("swap_body", "torso_myamulets", "skullamulet")
 
    if inst.components.fueled then
        inst.components.fueled:StartConsuming()
    end
   
	if owner.components.combat then
    	owner.components.combat.damagemultiplier = 1+.5
	end
	if owner.components.health then
    	owner.components.health:SetAbsorptionAmount(-(TUNING.WATHGRITHR_ABSORPTION*120))
   	end
end
 
local function onunequip(inst, owner)
    owner.AnimState:ClearOverrideSymbol("swap_body")
   
    if inst.components.fueled then
        inst.components.fueled:StopConsuming()
    end
   

    if owner.components.combat then
    	owner.components.combat.damagemultiplier = 1
	end
	if owner.components.health then
    	owner.components.health:SetAbsorptionAmount(0)
   	end
end

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...