Jump to content

Recommended Posts

local function Petrify(inst)
    inst.components.petrifiable:Petrify(true)
end

local function AdjustSetOnIgniteFn(inst)
    if not GLOBAL.TheWorld.ismastersim then
        return
    end

   inst.components.burnable:SetOnIgniteFn(Petrify)
end

local evergreens = {
    "evergreen",
    "evergreen_normal",
    "evergreen_tall",
    "evergreen_short",
}

for i, prefab in ipairs(evergreens) do
    AddPrefabPostInit(prefab, AdjustSetOnIgniteFn)
end

this works only if i manually spawn in a ever green tree, but not the ones natually appear in the world

to everything that already spawn you need to doing like this
AddSimPostInit(function()
        local nests = GLOBAL.TheSim:FindEntities(0, 0, 0, 10000, { "tallbirdnest" })
        for _, inst in ipairs(nests) do
            if inst.components and inst.components.childspawner then
                inst.components.childspawner:SetRegenPeriod(60)
            end
        end
    end)

for exampe i change tallbird respawn in tallbirdnest about 60 seconds

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