DevilsRoost Posted October 20, 2020 Share Posted October 20, 2020 SO I've got my character to shed nightmare fuel in the same interval as the bearger. BUT I would now like him to shed two items at once, nightmare fuel and beard hair. Here's the code I've got inst:AddComponent("shedder") inst.components.shedder.shedItemPrefab = "nightmarefuel" inst.components.shedder.shedHeight = .5 inst.components.shedder:StartShedding(TUNING.BEARGER_SHED_INTERVAL * 20) Do I just paste this in again but with beard hair instead of nightmare fuel or is there a way with more finesse? Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/122613-shedding-two-items-at-once/ Share on other sites More sharing options...
Thomas_klei Posted October 20, 2020 Share Posted October 20, 2020 (edited) inst:DoPeriodicTask(TIME, function(inst) local item = "YOUR_ITEM" local item_ = "ANOTHER_ITEM" if item ~= nil then local x, y, z = inst.Transform:GetWorldPosition() item.Transform:SetPosition(x + math.random() - .5, SHED_HIEGHT, z + math.random() - .5) item_.Transform:SetPosition(x + math.random() - .5, SHED_HIEGHT, z + math.random() - .5) end return item end end) I think that would make it only shed one item because the component only has one shedprefab so it would replace the other one so i made this one just in case it doesn't work, this is from the shedder component (sorry for shoddy coding) you'll need to replace some variables so i put them in capital letters Edited October 20, 2020 by thomas4846 Link to comment https://forums.kleientertainment.com/forums/topic/122613-shedding-two-items-at-once/#findComment-1381963 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