Jump to content

Script for an Actor


TheSkoomaKing

Recommended Posts

Hi guys im trying to make a script for a specific actor. A Sabrecat for that matter. I want my actor to get a invisible spell everytime the player sneaks. I know how to, but i just do not know what event to use for the actor.

 

 


Scriptname aaCatSneakingScript extends ObjectReference  

Spell Property InvisibleSpell Auto

event onActivate(objectReference AkActor)

if game.getplayer().IsSneaking()


AkActor.Addspell(InvisibleSpell)


Endif


Endevent

 

I choose Event onactivate cause i found another script that was placed on the npc itself that was using it. have no clue if its wrong or right, but this is the errors i get:

 

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaCatSneakingScript.psc(12,8): Addspell is not a function or does not exist

No output generated for aaCatSneakingScript, compilation failed.

 

anyone know how to fix this?

Link to comment
Share on other sites

There's a better way. Create a new Ability for your SabreCat and place a script (extending ActiveMagicEffect) on it as a magic effect. Put a condition on the magic effect in the Ability spell to test for "IsSneaking" on the Player. That way the ability will only become active whenever the player sneaks. In your script, use the OnEffectStart event. Edited by steve40
Link to comment
Share on other sites

I am not sure i follow what u mean here. Cause a Animal cannot really sneak so if you do like you said. or as i understood it anyways, you create a spell that works similar as the " Nightengale Perk" which makes you invisible once

your sneaking. But as a said, since this follower is a animal he doesn't have any sneaking animation so he is not sneaking :). Is there any scripting way to make this work?

 

 

 

btw sorry for late reply, have been Christmas and all that ^^

Edited by TheSkoomaKing
Link to comment
Share on other sites

There's a better way. Create a new Ability for your SabreCat and place a script (extending ActiveMagicEffect) on it as a magic effect. Put a condition on the magic effect in the Ability spell to test for "IsSneaking"on the Player. That way the ability will only become active whenever the player sneaks. In your script, use the OnEffectStart event.

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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