Sign in to follow this  
. . .

(Solved) Way to check who gave container an item or took an item from it?

Recommended Posts

. . .    4145

Is there a way I can somehow add data in container component in its pushedevent of itemlose and itemget to see what entity took or gave the item?

 

Edited by . . .

Share this post


Link to post
Share on other sites
penguin0616    1085

I believe this is relevant for your situation.


Perhaps something like this.

local function OnItemGet(inst, data)
		local player = inst.components.container.currentuser

        if data and data.item then
                print(player, "put", data.item, "in a container.")
        end
end

inst:ListenForEvent("itemget", OnItemGet)

 

  • Thanks 1

Share this post


Link to post
Share on other sites
. . .    4145

My brain's just having constant 404 errors when I code new stuff even when I should know how to go about them lol and thanks a lot it worked perfectly. 

Share this post


Link to post
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
Sign in to follow this