Makaoshi Posted August 26, 2021 Share Posted August 26, 2021 Sorry if you don't understand what I'm saying is that I don't speak English but I would like your help. this the code I was using: inst: ListenForEvent ("killed", function (inst, data) local victim = data.victim if (victim ~ = nil and victim.prefab == "butterfly") then inst.components.sanity: DoDelta (-10) end end ) I just don't know why it doesn't work with ocean fish, or lobsters and salamanders. I would greatly appreciate your help sincerely. Makaoshi. ♡♡♡ Link to comment https://forums.kleientertainment.com/forums/topic/132999-i-need-help-so-that-when-my-character-kills-some-type-of-ocean-fish-he-loses-sanity-lobsters-and-salamanders/ Share on other sites More sharing options...
Monti18 Posted August 27, 2021 Share Posted August 27, 2021 inst: ListenForEvent ("killed", function (inst, data) local victim = data.victim if (victim ~= nil and (victim.prefab == "wobster_sheller_land" or victim.prefab == "fruitdragon")) then inst.components.sanity: DoDelta (-10) end end ) The code that you have is only working for butterflys, if you want it to work with other creatures you will need to add the prefab name like it did in this example. This will work for lobsters and saladmanders, the ocean fish will need to be added by yourself 1 Link to comment https://forums.kleientertainment.com/forums/topic/132999-i-need-help-so-that-when-my-character-kills-some-type-of-ocean-fish-he-loses-sanity-lobsters-and-salamanders/#findComment-1488785 Share on other sites More sharing options...
Makaoshi Posted August 27, 2021 Author Share Posted August 27, 2021 (edited) Thank you very much for the help, for days I tried to do something like that and nothing worked. ♡♡♡♡♡ Makaoshi. Edited August 27, 2021 by Makaoshi Link to comment https://forums.kleientertainment.com/forums/topic/132999-i-need-help-so-that-when-my-character-kills-some-type-of-ocean-fish-he-loses-sanity-lobsters-and-salamanders/#findComment-1488832 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