Hatsune_Miku Posted November 27, 2016 Share Posted November 27, 2016 I'm new to modding. I want folowing perks for my character. Gain sanity when near others. Gain +10 to max sanity , hunger , health each time when revived Turn invisible for 10 seconds (70% transparent) (Monsters lose track of you and cannot attack you unless you attack them first) when pressing E If you can write it so I can understand how to make similar things next time I would be thankful. Link to comment Share on other sites More sharing options...
Hatsune_Miku Posted December 7, 2016 Author Share Posted December 7, 2016 Anyone? Link to comment Share on other sites More sharing options...
. . . Posted December 7, 2016 Share Posted December 7, 2016 I think this would make your character gain sanity from being close to other players, put it in YOURCHARACTER.lua inside master_postinit Spoiler -- Sanity gain from nearby players local function sanityfn(inst) local x,y,z = inst.Transform:GetWorldPosition() local delta = 0 local rad = 10 local rad_sq = rad*rad for k,v in pairs(AllPlayers) do if v ~= inst then local distsq = inst:GetDistanceSqToInst(v) if distsq < rad_sq then local sz = TUNING.SANITYAURA_TINY * rad delta = delta + sz/math.max(1, distsq) end end end return delta end inst.components.sanity.custom_rate_fn = sanityfn The other ones Idk, sorry Link to comment Share on other sites More sharing options...
Someonestolemeberrys Posted December 7, 2016 Share Posted December 7, 2016 2 minutes ago, SuperDavid said: I think this would make your character gain sanity from being close to other players, put it in YOURCHARACTER.lua inside master_postinit Hide contents -- Sanity gain from nearby players local function sanityfn(inst) local x,y,z = inst.Transform:GetWorldPosition() local delta = 0 local rad = 10 local rad_sq = rad*rad for k,v in pairs(AllPlayers) do if v ~= inst then local distsq = inst:GetDistanceSqToInst(v) if distsq < rad_sq then local sz = TUNING.SANITYAURA_TINY * rad delta = delta + sz/math.max(1, distsq) end end end return delta end inst.components.sanity.custom_rate_fn = sanityfn The other ones Idk, sorry I wished i had brains like that. 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