Jump to content

Help Needed: Script run on level up.


Icevix

Recommended Posts

Hiya! I'm currently trying to make a mod that adds 2 stamina and magicka to the player on level up. I've got a script down to this:

 

 

Scriptname PassiveStamMag
{Scriptname PassiveStamMag extends Quest
import Game
Event OnStoryIncreaseLevel(int aiNewLevel)
;do player.modav Stamina 2
;do player.modav Magicka 2
self.reset()
endEvent}
And have tried adding it to a quest that that runs on the event "increase level" I'm rather new to modding, and I can't seem to figure out how to make this work. My scripting might be shoddy too. Any help would be greatly appreciated.
Link to comment
Share on other sites

The main problem with your script is that modav doesn't change the base value (and that the ; means your functions won't do anything).
You only need one script; no need to point this one to another.




Scriptname PassiveStamMag extends Quest

import Game

string Actor = Game.GetPlayer()

float BaseStamina
float BaseMagicka

Event OnStoryIncreaseLevel (int aiNewLevel)
BaseStamina = Actor.GetBaseActorValue("Stamina")
BaseMagicka = Actor.GetBaseActorValue("Magicka")

Player.SetActorValue ("Stamina", BaseStamina + 2)
Player.SetActorValue ("Magicka", BaseStamina + 2)
EndEvent()

 

 

edit: Change ("Magicka", BaseStamina + 2) to ("Magicka", BaseMagicka + 2). Sorry, I originally posted from my phone and didn't notice the error.

Edited by StormWalker183
Link to comment
Share on other sites

  • Recently Browsing   0 members

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