Jump to content

Recommended Posts

Hello. I want to make a mod that makes it so clockworks drop electrical doodads when killed. Only problem is that when I tried to reuse code from my other mod, Tallbirds drop Drumsticks, I cant get the server to load. Here's the code I'm using:

AddPrefabPostInit("knight", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 2)
    end
end)

AddPrefabPostInit("bishop", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 2)
    end
end)

AddPrefabPostInit("rook", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 2)
    end
end)

AddPrefabPostInit("knight_nightmare", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 0.33)
    end
end)

AddPrefabPostInit("bishop_nightmare", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 0.33)
    end
end)

AddPrefabPostInit("rook_nightmare", function(inst)
    if inst.components.lootdropper ~= nil then
        inst.components.lootdropper.loot = GLOBAL.ExtendedArray(inst.components.lootdropper.loot, "transistor", 0.33)
    end
end)

Can anyone tell me how to get this to work?

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...