Fuffles Posted October 25, 2017 Share Posted October 25, 2017 Hello, I'd like to stop the bee outcome when a character has a specific Tag, but have completly no idea how to begin/do it. Any pro LUA-users that could help me with that? Link to comment https://forums.kleientertainment.com/forums/topic/83355-stop-releasing-bees-from-bee-boxes-if-a-certain-tag-is-there/ Share on other sites More sharing options...
w00tyd00d Posted October 25, 2017 Share Posted October 25, 2017 (edited) @DragonflyTheGiant That's an easy one Spoiler -- Plop this bad larry in your modmain.lua function BeeboxPostInit(inst) local function setlevel(inst, level) if not inst:HasTag("burnt") then if inst.anims == nil then inst.anims = { idle = level.idle, hit = level.hit } else inst.anims.idle = level.idle inst.anims.hit = level.hit end inst.AnimState:PlayAnimation(inst.anims.idle) end end local function updatelevel(inst) if not inst:HasTag("burnt") then for k, v in pairs(levels) do if inst.components.harvestable.produce >= v.amount then setlevel(inst, v) break end end end end local function new_onharvest(inst, picker) if not inst:HasTag("burnt") then updatelevel(inst) if inst.components.childspawner ~= nil and not (GLOBAL.TheWorld.state.iswinter or picker:HasTag("<your tag here>")) then -- replace this with your tag inst.components.childspawner:ReleaseAllChildren(picker) end end end if GLOBAL.TheWorld.ismastersim then inst.components.harvestable:SetUp("honey", 6, nil, new_onharvest, updatelevel) end end Hope this helps! Edited October 25, 2017 by w00tyd00d Link to comment https://forums.kleientertainment.com/forums/topic/83355-stop-releasing-bees-from-bee-boxes-if-a-certain-tag-is-there/#findComment-966945 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