jjdamstra Posted February 17, 2015 Share Posted February 17, 2015 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) Link to comment 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.