Jump to content

Recommended Posts

This is likely a rather simple question to ask: Is there a method that is called when a player picks up an item? I want to perform some logic on any items picked up by my character but I'm struggling to find such a method. I assumed there would be some OnPickup method in the inventory component but I've had no luck with finding anything.

Edited by codelyoko373
Link to comment
https://forums.kleientertainment.com/forums/topic/142574-inventory-onpickup/
Share on other sites

3 hours ago, Bumber64 said:

local function OnPickup(inst, data) --put this anywhere in character file
    --inst is player, data.item is item
end

inst:ListenForEvent("onpickup", OnPickup) --put this in character fn

I realise that I misunderstood what picking up an item would mean in terms of the game. Basically I'm looking for a method that is called whenever anything is added to the players inventory. That PickUp event isn't triggered on you for example harvesting grass and adding that to your inventory 

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