• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Cruces

  • Rank
    Junior Member
  1. dammit, another useless thread by me.... they really should allow people to delete them, please ignore this ):
  2. Hello, I'm trying to create a mod that will craft two stones, I managed to add the recipe in the recipe tab, and created the prefabs for them however when i click on the recipe to create those items I get an error without adding the AddPhysics() line I got an unknown error after adding it i got the error "attempt to call method 'AddPhysics' (a nil value)" below is the code of my prefab local assets ={ Asset("IMAGE", "images/inventoryimages/angelstone.tex"), Asset("ATLAS", "images/inventoryimages/angelstone.xml"), Asset("IMAGE", "images/inventoryimages/devilstone.tex"), Asset("ATLAS", "images/inventoryimages/devilstone.xml"),}local function use_stone(inst) print "started using" if inst:HasTag("angelstone") then print "used angelstone" elseif inst:HasTag("devilstone") then print "used devilstone" else print "WTF?" endendlocal function commonfn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst:AddPhysics() MakeInventoryPhysics(inst) inst:AddComponent("inventoryitem") --inst.AddComponent("useableitem") --inst.components.useableitem:SetOnUseFn(use_stone) --inst:AddComponent("inspectable") --inst.entity:AddTransform() --inst.entity:AddAnimState() return instendlocal function angelstone() local inst = commonfn() inst:AddTag("angelstone") inst.components.inventoryitem.atlasname = "images/inventoryimages/angelstone.xml"endlocal function devilstone() local inst = commonfn() inst:AddTag("devilstone") inst.components.inventoryitem.atlasname = "images/inventoryimages/devilstone.xml"endreturn Prefab( "common/inventory/angelstone", angelstone, assets), Prefab( "common/inventory/devilstone", devilstone, assets) what am I doing wrong?