Dyk Posted January 4, 2016 Share Posted January 4, 2016 (edited) So I'm working on a character for my first mod, and i got a lot of problems with the perks --Perk 1 - Gain 2x dmg when is with 45 less sanity --Perk 2 - Loses sanity when is close to women --Perk 3 - Take more fire dmg --Perk 4 - Recover more hunger with food sry for bad english i'm using a translator FINISHED, Thanks for all Edited January 4, 2016 by Dyk Link to comment https://forums.kleientertainment.com/forums/topic/61847-help-character-perk/ Share on other sites More sharing options...
Dyk Posted January 4, 2016 Author Share Posted January 4, 2016 So I'm working on a character for my first mod, and i got a lot of problems with the perks --Perk 1 - Gain 2x dmg when is with 45 less sanity --Perk 2 - Loses sanity when is close to women --Perk 3 - Take more fire dmg --Perk 4 - Recover more hunger with food sry for bad english i'm using a translator I tried this for the dmg mult but doesnt work if inst.components.sanity.currentSanity < 45 then inst.components.combat.damagemultiplier = 5 end I dont know how use the "local" i have searched but i realy dont fond nothing. Link to comment https://forums.kleientertainment.com/forums/topic/61847-help-character-perk/#findComment-705087 Share on other sites More sharing options...
Dyk Posted January 4, 2016 Author Share Posted January 4, 2016 From the 2nd perk i have take a code of a another mod, "sanji", but he gain sanity when is close to women, how i can change to lose?local function isWoman(name) for k, v in ipairs(GLOBAL.CHARACTER_GENDERS.FEMALE) do if v == name then return true end end return falseend AddPlayerPostInit(function(inst) if isWoman(inst.prefab) then if not inst.components.sanityaura then inst:AddComponent("sanityaura") end local old = inst.components.sanityaura.aurafn inst.components.sanityaura.aurafn = function(inst, observer) local ret = 0 if old ~= nil then ret = old(inst, observer) end if observer.prefab == "sanji" then return GLOBAL.TUNING.SANITYAURA_SMALL + ret end return ret end endend) Link to comment https://forums.kleientertainment.com/forums/topic/61847-help-character-perk/#findComment-705182 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