Residays Posted January 21, 2018 Share Posted January 21, 2018 Hi, I haven't been able to succeed in my past two threads, so I'm gonna try something else: My question is in the title, here are the properties I need: prod.components.burnable prod.components.container prod.components.crop prod.components.dryer prod.components.harvestable prod.components.machine prod.components.wardrobe prod.components.sleepingbag prod.components.deployable I hope you guys don't mind but ima tag a few modders to see if they can help me, because I have tried a bunch of times and got crashes so eventually I gave up with the old methods, and the code AlainMCD gave me didn't work: @alainmcd @JohnWatson Link to comment https://forums.kleientertainment.com/forums/topic/86652-giving-all-existing-prods-with-these-properties-a-tag-on-world-load/ Share on other sites More sharing options...
CarlZalph Posted January 21, 2018 Share Posted January 21, 2018 (edited) I'm not sure what you're asking for, but this is what I think you're trying to ask for. local function HookThis(component) AddComponentPostInit( component, function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst.inst:AddTag("Ayy") end ) end local HookThese = { "burnable", "container", "crop", "dryer", "harvestable", "machine", "wardrobe", "sleepingbag", "deployable", } for _,v in pairs(HookThese) do HookThis(v) end Edited January 21, 2018 by CarlZalph inst -> inst.inst Link to comment https://forums.kleientertainment.com/forums/topic/86652-giving-all-existing-prods-with-these-properties-a-tag-on-world-load/#findComment-994689 Share on other sites More sharing options...
Residays Posted January 21, 2018 Author Share Posted January 21, 2018 49 minutes ago, CarlZalph said: I'm not sure what you're asking for, but this is what I think you're trying to ask for. local function HookThis(component) AddComponentPostInit( component, function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:AddTag("Ayy") end ) end local HookThese = { "burnable", "container", "crop", "dryer", "harvestable", "machine", "wardrobe", "sleepingbag", "deployable", } for _,v in pairs(HookThese) do HookThis(v) end Thanks for your time so far! Link to comment https://forums.kleientertainment.com/forums/topic/86652-giving-all-existing-prods-with-these-properties-a-tag-on-world-load/#findComment-994697 Share on other sites More sharing options...
CarlZalph Posted January 21, 2018 Share Posted January 21, 2018 13 minutes ago, Residays said: Thanks for your time so far! Yeah, changed that in an edit. Link to comment https://forums.kleientertainment.com/forums/topic/86652-giving-all-existing-prods-with-these-properties-a-tag-on-world-load/#findComment-994703 Share on other sites More sharing options...
Residays Posted January 21, 2018 Author Share Posted January 21, 2018 7 minutes ago, CarlZalph said: Yeah, changed that in an edit. Thank you so much, you're a life saver!! How can I thank you? Link to comment https://forums.kleientertainment.com/forums/topic/86652-giving-all-existing-prods-with-these-properties-a-tag-on-world-load/#findComment-994704 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