Jump to content

Script compiles, but does nothing


Cirosan

Recommended Posts

I'm still cutting my teeth on Papyrus. This script compiles just fine, but doesn't actually do anything. It's attached to a potion that's supposed to check to see if the player meets the requirements, and if they do, it gives them a perk; if they don't, it shows them a message and re-adds another copy of the potion. However, the script doesn't do either - the potion is consumed, but nothing happens.

 

The script is:

Scriptname CCOAdrenalineJunkie01Script extends activemagiceffect



Perk Property CCOAdrenalineJunkie01 Auto Const



Potion Property CCOItemAdrenalineJunkie01 Auto Const



ActorValue Property Intelligence Auto Const



Message Property CCOReqsNotMet Auto Const



Int Property lvlReq auto



Float Property statReq auto



Event OnEffectStart(Actor Target, Actor Caster)



Actor player = Game.GetPlayer()

int levelReq = Player.GetLevel()

statReq = Game.GetPlayer().GetBaseValue(Intelligence)



if statReq >= 6 && levelReq >= 5

    Game.GetPlayer().AddPerk(CCOAdrenalineJunkie01)

else

    CCOReqsNotMet.Show()

    player.addItem(CCOItemAdrenalineJunkie01, 1)

endif



EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...