Page 1 of 1

Help need to make a spell script :S

Posted: Mon Nov 29, 2010 7:25 pm
by Oblis
Hello!
I m trying to make a custom spell, that will be added to player's spellbook abd when he casts it on an NPC, that will turn NPC's stats on in a texbox.
I have made the script atm using GetContainer function which gives me results when i enter NPC's invtentory.
Example:

ScriptName REPORT

ref ReportTarget
String_var NPCName
Short NPCBaseHealth

Begin GameMode
set ReportTarget to getcontainer

Set NPCName to ReportTarget.GetName

Set NPCHealth to ReportTarget.GetActorValue Health

End

but i really want to change it and be activated when player cast a spell on the chanracter.
I searched a lot but cant find the correct expression to replace the set ReportTarget to getcontainer.
Can anyone help?

Re: Help need to make a spell script :S

Posted: Tue Nov 30, 2010 12:35 am
by PrinceShroob
I believe the function that you're looking for is "GetSelf."

Re: Help need to make a spell script :S

Posted: Tue Nov 30, 2010 12:47 am
by Oblis
That worked!
Thanks