Jump to content

Recommended Posts

Hello Dear Survivors

I'd like to implement a feature to grow Mushroom trees with an item, althought Im unsure how to do so, becuase Im still kinda new to modding, could somebody help? I used the acorn.lua (aka the Birchnut File from prefabs) as the thing for my item.

local function plant(inst, growtime)
    local sapling = SpawnPrefab("mushtree_small")
    sapling.Transform:SetPosition(inst.Transform:GetWorldPosition())
    sapling.SoundEmitter:PlaySound("dontstarve/wilson/plant_tree")
    inst:Remove()
end

Replacing 'plant' function with this one above should work I think.

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