Jump to content

Carrot Drop


jjdamstra

Recommended Posts

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

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.

×
  • Create New...