Ctrl-Alt-Rage Posted February 18, 2023 Share Posted February 18, 2023 (edited) Is there a resource I can check out that shows how to restrict or filter specific items that can go into a container? For example - if I made a custom toolchest and wanted it so only "tools" could go inside of it. Edited February 18, 2023 by Ctrl-Alt-Rage Link to comment Share on other sites More sharing options...
Torulo Posted March 11 Share Posted March 11 I'm not any lua expert as i'm walking my first steps in that matter (i'm C# Unity developer) but i managed to solve the same issue, as i wanted to make a special container for ammunition only. On your container item script you need to add "AcceptItemFunction = AcceptItemTool" (Custom function called on each item transfer, in this case i've created AcceptItemTool). Add that function with a code similar to this on your client side, which will return true if the type of the item being transfered is equal to Tool for this case: function AcceptItemTool(container, item) return item:getStringItemType() == "Tool" end 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