Script Confirmation for spell that adds Additem

Post » Fri Dec 12, 2014 11:26 am

This is just a sample. I would not actually use this specifically but the idea would be simple.

I am wondering if this is the correct format and if it would work.

I know it would be added to the spell effect but don't like adding scripts unless I know they will work as intended.

Scriptname AddItemSpellScript extends activemagiceffect  ObjectReference Property MiscObject AutoEVENT OnEffectFinish(Actor akTarget, Actor akCaster)Game.GetPlayer().AddItem(Gold001, 1)EndEvent
User avatar
Emma Pennington
 
Posts: 3346
Joined: Tue Oct 17, 2006 8:41 am

Post » Fri Dec 12, 2014 6:06 pm

You've pretty much got it. Just one small error with your property - might have been a typo - You need to define Gold001 as the property if that's the item you're using:

Spoiler
Scriptname AddItemSpellScript extends activemagiceffect  ;should follow the format: Type Property variable_name Auto;the original wont work because ObjectReference and MiscObject are both TypesMiscObject Property Gold001 Auto ;make sure you also "fill" this property in the Creation Kit after attaching your script (hit the Properties button under the script pane)EVENT OnEffectFinish(Actor akTarget, Actor akCaster)Game.GetPlayer().AddItem(Gold001, 1)EndEvent
User avatar
Robert Bindley
 
Posts: 3474
Joined: Fri Aug 03, 2007 5:31 pm

Post » Fri Dec 12, 2014 8:53 am

Thank you.

Tested it and it works like a charm. :twirl:

Thanks for the help!

User avatar
Arnold Wet
 
Posts: 3353
Joined: Fri Jul 07, 2006 10:32 am


Return to V - Skyrim