jjdamstra Posted February 17, 2015 Share Posted February 17, 2015 (edited) Hi, I'm trying to add a random chance to get an extra carrot when picked this is what I'm using local function AddNewCarrotDrop(inst)local ranNum = math.random(2)inst.components.pickable:SetUp("carrot", 10, ranNum)end AddPrefabPostInit("carrot", AddNewCarrotDrop) I keeps crashing attempt to index field 'pickable' (a nil value) modmain.lua (3,1) Edited February 17, 2015 by jjdamstra Link to comment https://forums.kleientertainment.com/forums/topic/51105-carrot-drop/ Share on other sites More sharing options...
Sketchiverse Posted February 19, 2015 Share Posted February 19, 2015 I believe that the item named "carrot" is the one that you eat. The carrot item you're trying to modify is the one that you pick on the ground and it's called "carrot_planted", even though you find it in the prefabs as carrot.lua. Link to comment https://forums.kleientertainment.com/forums/topic/51105-carrot-drop/#findComment-614690 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