Jump to content

[HELP] Causing an item to vanish on drop


Recommended Posts

I have an item added in as a mod, but I'd like to make the item completely vanish if it is dropped. I have figured out how to make the model disappear, but if I hold the spacebar my character will still pick the item up. Is there any way to make the item just disappear completely?

 

Thanks in advance.

Link to comment
Share on other sites

@Verior, inst:Remove()

 

I hate to be such a pest, but I don't understand.

I have this right now:

local function fn(Sim)	local inst = CreateEntity()	local trans = inst.entity:AddTransform()	local anim = inst.entity:AddAnimState()	inst.entity:AddSoundEmitter()        MakeInventoryPhysics(inst)    inst:AddComponent("inventoryitem")    inst.components.inventoryitem:ChangeImageName("goldenaxe")    inst:AddComponent("weapon")    inst.components.weapon:SetDamage(40)    inst:AddComponent("tool")    inst.components.tool:SetAction(ACTIONS.CHOP,   10)    if drop then        inst:Remove()    end

But I'm not sure what to put where I wrote "drop" in larger letters. 

 

PeterA Edit: fixed formatting issue

 

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...