Need help with scripting a disguise object

Post » Mon Jun 18, 2012 9:23 pm

Here is my attempt to create a disguise script. The point is when you equip an object as a lvl 4 vampire you will no longer be attacked on sight I have tried many different ideas and scripts please help in any way you can. This script compiles properly but has no effect in game.

Script:


Scriptname aavampdisguise extends ObjectReference
FormList property CrimeFactions auto
Faction property VampirePCFaction auto


Function EverybodyHatesMe(bool IsItTrue)
if IsItTrue
Game.GetPlayer().AddtoFaction(VampirePCFaction)
else
Game.GetPlayer().RemoveFromFaction(VampirePCFaction)
endif
Game.GetPlayer().SetAttackActorOnSight(IsItTrue)
int cfIndex = 0
while (cfIndex < CrimeFactions.GetSize())
(CrimeFactions.GetAt(cfIndex) as Faction).SetPlayerEnemy(IsItTrue)
cfIndex += 1
endwhile
EndFunction






Event OnEquipped (Actor AkActor)

if AkActor == Game.GetPlayer()
EverybodyHatesMe(false)

endif



EndEvent


Event OnUnequipped (Actor AkActor)

if AkActor == Game.GetPlayer()
EverybodyHatesMe(true)
endif

EndEvent
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Tue Jun 19, 2012 2:03 am

bump
User avatar
Jeff Turner
 
Posts: 3458
Joined: Tue Sep 04, 2007 5:35 pm

Post » Tue Jun 19, 2012 7:16 am

Bump
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Mon Jun 18, 2012 4:22 pm

If you want paste onequipped on object it don't work all times you equip it from menu or script . Onequipped work only when you change cell or load object. i tried it on armors (disguise faction when you wear armor), but nothing.
User avatar
adame
 
Posts: 3454
Joined: Wed Aug 29, 2007 2:57 am


Return to V - Skyrim