Jump to content

Custom item crash on mod enabling

Recommended Posts

I tried to make a dupe of willow's lighter without any functions. Everytime i enable it, it crashes. The coding:



PrefabFiles = {    "lighter2"} Assets = {    Asset("IMAGE", "images/inventoryimages/lighter2.tex"),	Asset("ATLAS", "images/inventoryimages/lighter2.xml"),	} GLOBAL.STRINGS.NAMES.LIGHTER2 = "The Darkened's Lighter"GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.LIGHTER2 = "It breathes darkness..."



local assets ={    Asset("ANIM", "anim/lighter.zip"),	Asset("ATLAS", "images/inventoryimages/lighter2.xml"),	Asset("IMAGE", "images/inventoryimages/lighter2.tex"),} local function fn()        local inst = CreateEntity()         inst.entity:AddTransform()        inst.entity:AddAnimState()        inst.entity:AddSoundEmitter()        inst.entity:AddNetwork()         MakeInventoryPhysics(inst)         inst.AnimState:SetBank("lighter")        inst.AnimState:SetBuild("lighter")        inst.AnimState:PlayAnimation("idle")         if not TheWorld.ismastersim then            return inst        end         inst.entity:SetPristine()         inst:AddComponent("inspectable")        --inst:AddComponent("stackable")        --inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM        -- Remove the -- from the 2 lines above to make this item able to stack more than 1, TUNING.STACK_SIZE_SMALLITEM is 20 I believe.        inst:AddComponent("inventoryitem")		inst.component.inventoryitem.atlasname = "images/inventoryimages/lighter2.xml"		inst:AddComponent("equippable")         MakeHauntableLaunchAndIgnite(inst)         return instend return Prefab("common/inventory/lighter2", fn, assets) --You might need to change "common/lighter2" not sure tho...

Edited by DarkCrafter
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

  • Create New...