Sodarrific Posted December 30, 2021 Share Posted December 30, 2021 I'm fairly new so ignore this if you don't care How do you grant instant (not over time) sanity gain from killing certain creatures? e.g. spiders I understand that DoDelta can be used, but I have no clue how to activate it via killing a certain entity. If you can give a straight answer or link a tutorial that'd be great. Link to comment Share on other sites More sharing options...
Sodarrific Posted December 30, 2021 Author Share Posted December 30, 2021 (edited) local function OnKill(victim,inst) if victim and victim:HasTag() then if victim:HasTag == "monster" then inst.components.sanity:DoDelta(10) end end end unsure if something like this would work. Edited December 30, 2021 by Sodarrific Link to comment Share on other sites More sharing options...
Sodarrific Posted December 30, 2021 Author Share Posted December 30, 2021 got it local function onkilled(inst, data) if data ~= nil and data.victim ~= nil and data.victim:HasTag("monster") then inst.components.sanity:DoDelta(50) inst.components.hunger:DoDelta(40) inst.components.health:DoDelta(15) end end 1 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