Meepenator Posted 17 hours ago Share Posted 17 hours ago Hi, I'm trying to figure out how to check for the amount of creatures that are stacked and have been murdered(the actual action against butterflies, rabbits and bees) with this code and heal the amount but I can't figure out how to do so properly. local function onmurderheal(inst,data) if inst.components.health.currenthealth > 0 and inst:HasTag("Dsacrifice") and data.components.stackable ~= nil then if data.components.stackable.stacksize ~= nil then local healthdo = ( data.components.stackable.stacksize * 25) local hungerdo = ( data.components.stackable.stacksize * 10) local sanitydo = ( data.components.stackable.stacksize * 5) inst.components.health:DoDelta(healthdo) inst.components.hunger:DoDelta(hungerdo) inst.components.sanity:DoDelta(sanitydo) end elseif inst.components.health.currenthealth > 0 and inst:HasTag("Dsacrifice") then inst.components.health:DoDelta(25) inst.components.hunger:DoDelta(10) inst.components.sanity:DoDelta(5) end end Link to comment https://forums.kleientertainment.com/forums/topic/172425-trying-to-check-how-many-creatures-have-been-murdered/ 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