Yumesuki Posted April 21, 2015 Share Posted April 21, 2015 (edited) Hi, I was trying to figure out a way to set it so my custom character is unable to craft anything that uses living animals in the recipe. Any help would be much apreciated. I would assume there's something I can do with the builder component but I don't really know. Edited April 21, 2015 by Yumesuki Link to comment https://forums.kleientertainment.com/forums/topic/53009-making-some-items-uncraftable-by-a-certain-character/ Share on other sites More sharing options...
DarkXero Posted April 21, 2015 Share Posted April 21, 2015 (edited) So, inside your character's prefab:local forbidden = { minerhat = true, pumpkin_lantern = true, beebox = true, beemine = true, researchlab4 = true, rainhat = true, earmuffshat = true,}local function common_postinit(inst) inst:DoTaskInTime(0, function() local old = inst.replica.builder.CanLearn function inst.replica.builder:CanLearn(recname) if forbidden[recname] then return false else return old(self, recname) end end end)end Edited April 21, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/53009-making-some-items-uncraftable-by-a-certain-character/#findComment-631025 Share on other sites More sharing options...
Yumesuki Posted April 23, 2015 Author Share Posted April 23, 2015 (edited) Thanks much, worked perfectly. Is there something similar to CanLearn I can use to make the same items unable to be used if someone hands them to the character or they're picked up? Or would I need to do something that would check for certain items in the inventory and make the character drop them? Edited April 24, 2015 by Yumesuki Link to comment https://forums.kleientertainment.com/forums/topic/53009-making-some-items-uncraftable-by-a-certain-character/#findComment-631401 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