Randomdeamon Posted August 10, 2017 Share Posted August 10, 2017 Cant find the problem. Healtorch.lua Link to comment Share on other sites More sharing options...
Lumina Posted August 10, 2017 Share Posted August 10, 2017 Maybe you can explain what you are trying to do and copy here the code, so people will be able to help you better, without having to do too much search and testing. Link to comment Share on other sites More sharing options...
Randomdeamon Posted August 11, 2017 Author Share Posted August 11, 2017 13 hours ago, Lumina said: Maybe you can explain what you are trying to do and copy here the code, so people will be able to help you better, without having to do too much search and testing. trying to get an item to work. from what i get it might be a load up error, nothing to do with the character. local assets= { Asset("ANIM", "anim/Healtorch.zip"), Asset("ANIM", "anim/swap_Healtorch.zip"), Asset("ANIM", "anim/torch.zip"), Asset("ANIM", "anim/swap_torch.zip"), Asset("SOUND", "sound/common.fsb"), Asset("ATLAS", "images/inventoryimages/cadstaff.xml"), Asset("IMAGE", "images/inventoryimages/cadstaff.tex"), } local prefabs = { "torchfire" } local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "swap_Healtorch", "swap_Healtorch") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") inst.components.equippable.dapperness = TUNING.CRAZINESS_MED owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function OnUnequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function say(speaker, words) if speaker and speaker.components.talker then speaker.components.talker:Say(words) end end local function healtarget(staff, target) local owner = staff.components.inventoryitem.owner if target:HasTag("player") or not target:HasTag("monster") then target.components.health:DoDelta(40) else say(owner, "DontActdum.") end end local function usecadstaff(staff, target) local owner = staff.components.inventoryitem.owner if not owner:HasTag("mond") then say(owner, "I don't know how to use it!") return end if target ~= nil and target.components.health ~= nil then if target.components.health.currenthealth < target.components.health.maxhealth then healtarget(staff,target) else say(owner, "He's/She's fine") end end end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("torch") inst.AnimState:SetBuild("swap_torch") inst.AnimState:PlayAnimation("idle") inst.AnimState:SetBank("cadstaff") inst.AnimState:SetBuild("cadstaff") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst.entity:SetPristine() inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.imagename = "Healtorch" inst.components.inventoryitem.atlasname = "images/inventoryimages/cadstaff.xml" inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(usecadstaff) inst.components.spellcaster.canuseontargets = true inst.components.spellcaster.canonlyuseonlocomotors = true inst:AddComponent("weapon") inst.components.weapon:SetDamage(TUNING.TORCH_DAMAGE) inst:AddComponent("equippable") inst.components.equippable:SetOnEquip( OnEquip ) inst.components.equippable:SetOnUnequip( OnUnequip ) return inst end return Prefab("common/inventory/Healtorch", fn, assets, prefabs) Link to comment Share on other sites More sharing options...
ZupaleX Posted August 11, 2017 Share Posted August 11, 2017 You should check out Lumina stickied post about how to ask for help and try again Link to comment Share on other sites More sharing options...
Lumina Posted August 11, 2017 Share Posted August 11, 2017 I should probably have linked it too. Link to comment Share on other sites More sharing options...
alainmcd Posted August 11, 2017 Share Posted August 11, 2017 Lua is case sensitive. Are you trying to give your character "Healtorch" or "healtorch"? Link to comment Share on other sites More sharing options...
Randomdeamon Posted August 12, 2017 Author Share Posted August 12, 2017 On 8/11/2017 at 4:32 PM, alainmcd said: Lua is case sensitive. Are you trying to give your character "Healtorch" or "healtorch"? Well i did fix that (didnt post it yet but trust me.), but i still get the same error Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now