Jump to content

[LE] Trying to get a command undead mod to work?


Recommended Posts

Hi there, I'm trying to get a spell I have written in the creation kit to work. The spell is meant to place undead under the control of the player, like the "command daedra" spell but for undead. I have written the following script to do it, based on the wood elf racial ability to control animals:

 

 

=============================================================

Scriptname mcsCommandUndeadScript extends ActiveMagicEffect
Faction Property CharmFaction Auto
bool Property bMakePlayerTeammate = false Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
akTarget.AddToFaction(CharmFaction)
akCaster.StopCombat()
akTarget.StopCombat()
if bMakePlayerTeammate
akTarget.SetPlayerTeammate(true, false)
endif
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
akTarget.RemoveFromFaction(CharmFaction)
if bMakePlayerTeammate
akTarget.SetPlayerTeammate(false, false)
endif
EndEvent
=============================================================
I have no idea why this isn't working. Can someone help? I'm new to scripting btw, so sorry if it's something very basic.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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