evilmarshmallow Posted April 4, 2025 Share Posted April 4, 2025 So I am making a custom held item and I was wondering if its possible to have it raise the sanity of other players when held? Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/ Share on other sites More sharing options...
Doodle Monster Posted April 4, 2025 Share Posted April 4, 2025 I'm new to modding but I figured this might be helpful This line adds sanity gain to a item you have equipt, not for other players but it's a start! inst.components.equippable.dapperness = TUNING.DAPPERNESS_LARGE Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/#findComment-1810917 Share on other sites More sharing options...
Doodle Monster Posted April 4, 2025 Share Posted April 4, 2025 Just make sure you add it in the prefab file, along with the other components 1 Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/#findComment-1810918 Share on other sites More sharing options...
Doodle Monster Posted April 4, 2025 Share Posted April 4, 2025 I was bored and did a little looking around and the nightlight uses this componet and function for it's sanity loss (Atleast I think) I'm not sure how you would apply that to a equiptable item, you might need someone who knows more. Hope this helps! local function CalcSanityAura(inst, observer) local lightRadius = inst.components.burnable ~= nil and inst.components.burnable:GetLargestLightRadius() or 0 return lightRadius > 0 and observer:IsNear(inst, .5 * lightRadius) and -.05 or 0 end inst:AddComponent("sanityaura") inst.components.sanityaura.aurafn = CalcSanityAura Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/#findComment-1810920 Share on other sites More sharing options...
Doodle Monster Posted April 4, 2025 Share Posted April 4, 2025 This is just a guess, with my limited knowlege of lua. but I think the compoent it looking for a number value here (This might work but it also might crash, so keep backups of your modfiles! This should be the only line you need *I think*) inst.components.sanityaura.aurafn = 2.0 1 Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/#findComment-1810922 Share on other sites More sharing options...
evilmarshmallow Posted April 7, 2025 Author Share Posted April 7, 2025 Oh geez I thought I set it to notify me of replies here but thanks for the tips! I'll see if I can figure something out! Link to comment https://forums.kleientertainment.com/forums/topic/165214-custom-held-item-question/#findComment-1811141 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