Jump to content

[help] item like lucy & how to equip items


Recommended Posts

I wish to make an item like lucy (minus the talking) however i can't figure out how to make fall out of your inventory when a play it is not meant for tries to pick it up.

the other issue is there away to make it auto equip upon spawning into the world.

thank you for your help =-3

Link to comment
Share on other sites

This should work in that no other player would be able to pick up the item.

Not sure what you mean by auto equip, the only thing I know you can do so far is make a player start with the item in his inventory. If that's the case, just add the item in his start_inv.

inst.components.inventoryitem.onputininventoryfn = function(inst, owner)
        if not (owner.prefab == "name of your character") then
            if not owner.components.container then
                inst:DoTaskInTime(0.1, function()
                    owner.components.inventory:DropItem(inst)
                    owner.components.talker:Say("What another player will say when they drop it")
                end)
            elseif     owner.components.container and not (owner.components.container.opener.prefab == "name of your character") then
                inst:DoTaskInTime(0.1, function()
                    owner.components.container:DropItem(inst)
                    owner.components.container.opener.components.talker:Say("What they will say")
                end)
            end
        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...