Jump to content

Scripting help


monkeyboi

Recommended Posts

This is an example code that will drain 1 pt of magicka every second, and will stop when the actor's magicka hits 0:

 

1. Make an item i.e. a ring, clutter, or something else that you can hold in your inventory. Make a spell that will add this item to the actor's inventory when they get hit by the spell. A script effect that has AddItem in a ScriptEffectStart block should work nicely.

 

2. Add the following script to your item:

 

scn DrainMagickaScript
float timer
ref actor

begin onadd
set actor to getcontainer
end

begin gamemode
if actor.getav magicka <= 0
  removeme
else
  if timer > 0 
     set timer to timer - getsecondspassed
  else
 	set timer to 1
     player.modav magicka -1
  endif
endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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