Jump to content

Recommended Posts

I'm trying to figure out the lootdropper, I'm trying to add a log to the bees as a drop. nothing is working. below is the code:

 

local SetSharedLootTable = GLOBAL.SetSharedLootTable
local MODBEE = GetModConfigData("MODBEE")
 
if MODBEE then
    local function updateLootTableBee(inst)
        local loot = {
            "honey",   
            "stinger",
        }
        SetSharedLootTable('bee',
        {
            {'log',  1},
        })
     if(inst.components.lootdropper) then
        inst.components.lootdropper:SetLoot(loot)
    inst.components.lootdropper:SetChanceLootTable('bee')
     end
  end
  AddPrefabPostInit("bee", updateLootTableBee)
end
Link to comment
https://forums.kleientertainment.com/forums/topic/163020-help-with-modding/
Share on other sites

On 1/8/2025 at 2:41 AM, Mitos_krabik said:

I'm trying to figure out the lootdropper, I'm trying to add a log to the bees as a drop. nothing is working. below is the code:

 

local SetSharedLootTable = GLOBAL.SetSharedLootTable
local MODBEE = GetModConfigData("MODBEE")
 
if MODBEE then
    local function updateLootTableBee(inst)
        local loot = {
            "honey",   
            "stinger",
        }
        SetSharedLootTable('bee',
        {
            {'log',  1},
        })
     if(inst.components.lootdropper) then
        inst.components.lootdropper:SetLoot(loot)
    inst.components.lootdropper:SetChanceLootTable('bee')
     end
  end
  AddPrefabPostInit("bee", updateLootTableBee)
end

Not tested yet

AddPrefabPostInit("bee", function(inst)
    if not TheWorld.ismastersim then
        return inst
    end
    if inst.components.lootdropper then
        inst.components.lootdropper:AddChanceLoot("log", 1)
    end
end)

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...