Zorkaz Posted May 17, 2020 Share Posted May 17, 2020 The setup:When you pick up a book a perk gets added. Depending on your character the perk level changes. The issue:I never get above Perk Level 2. Has anyone experience with adding perks?Or is the script at fault? The script: Scriptname SBAddPerkScience extends ObjectReference Perk Property Science01 Auto Perk Property Science02 Auto Perk Property Science03 Auto Perk Property Science04 Auto Actor Property PlayerRef Auto Message Property NewSkill Auto Event OnActivate(ObjectReference refAction) ObjectReference refPlayer = Game.GetPlayer() If PlayerRef.Hasperk(Science01) PlayerRef.AddPerk(Science02) NewSkill.show() Elseif PlayerRef.Hasperk(Science02) PlayerRef.AddPerk(Science03) NewSkill.show() Elseif PlayerRef.Hasperk(Science03) PlayerRef.AddPerk(Science04) NewSkill.show() Elseif PlayerRef.Hasperk(Science04) Game.RewardPlayerXP(400, True) Else PlayerRef.AddPerk(Science01) Endif EndEvent Link to comment Share on other sites More sharing options...
Zorkaz Posted May 17, 2020 Author Share Posted May 17, 2020 SolvedI had to make it reverse Scriptname SBAddPerkScience extends ObjectReference Perk Property Science01 Auto Perk Property Science02 Auto Perk Property Science03 Auto Perk Property Science04 Auto Actor Property PlayerRef Auto Message Property NewSkill Auto Event OnActivate(ObjectReference refAction) ObjectReference refPlayer = Game.GetPlayer() If PlayerRef.Hasperk(Science04) Game.RewardPlayerXP(400, True) Elseif PlayerRef.Hasperk(Science03) PlayerRef.AddPerk(Science04) NewSkill.show() Elseif PlayerRef.Hasperk(Science02) PlayerRef.AddPerk(Science03) NewSkill.show() Elseif PlayerRef.Hasperk(Science01) PlayerRef.AddPerk(Science02) NewSkill.show() Else PlayerRef.AddPerk(Science01) NewSkill.show() Endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts