Alright, I'm working on a mod that gives the player perks based on his/her karma level. (Yes, I'm aware that there is already a mod that does this, but I wanted to make my own, different functioning version.)
There are six karma based perks in all that I've made: one for 300 or more karma, 600 or more karma, 900 or more karma, -300 or less karma, -600 or less karma, and -900 or less karma. I've set the perks to be neither playable or hidden in their respective perk windows since I don't want people to be able to pick these perks up in the level up menu, but I also don't want them to be hidden from player view. It is set up so that the perks are removed if you fail to meet the karma requirement, but you also keep lesser perks once you unlock the better ones. (e.g: keep KarmaGood1 once you achieve KarmaGood2)
The problem then is that the perks aren't being added when the karma level is reached.
Here's the entire code I'm using.
scn KarmaPerkScript begin gamemode if (player.getav karma >= 300)player.addperk KarmaGood1elseplayer.removeperk KarmaGood1endifif (player.getav karma >= 600)player.addperk KarmaGood2elseplayer.removeperk KarmaGood2endifif (player.getav karma >= 900)player.addperk KarmaGood3elseplayer.removeperk KarmaGood3endifif (player.getav karma <= -300)player.addperk KarmaBad1elseplayer.removeperk KarmaBad1endifif (player.getav karma <= -600)player.addperk KarmaBad2elseplayer.removeperk KarmaBad2endifif (player.getav karma <= -900)player.addperk KarmaBad3elseplayer.removeperk KarmaBad3endifend