. . . Posted October 29, 2021 Share Posted October 29, 2021 i want to add prefabpostinit effecting all farm plants (and future ones) without having to do it manually or update each time klei adds a new farm plant. anybody knows what i'm doing wrong, to me this looks like it should work local function BigCrop(inst) inst.Transform:SetScale(10, 10, 10) end local PLANT_DEFS = require("prefabs/farm_plant_defs").PLANT_DEFS for k, v in pairs(PLANT_DEFS) do AddPrefabPostInit(v, BigCrop) end Link to comment Share on other sites More sharing options...
IronHunter Posted October 29, 2021 Share Posted October 29, 2021 I think its because v is just returning a table and you need to be a bit more specific Inside this table there is a prefab name so try this. for k, v in pairs(PLANT_DEFS) do AddPrefabPostInit(v.prefab, BigCrop) end 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now