I'm using an Ability with a custom script, which is added to the target when a certain spell is cast on them.
When they die, I use :
Target.AddItem([Clothing], 1)
Target.EquipItem([Clothing])
But the issue I have is it doesn't work...
If I run this inside an OnUpdate() event, nothing happens at all; if I run it on an OnEffectFinish() they equip and unequip the item of clothing indefinitely...
It seems like the code is working fine, but it seems like it's tied to effect, like it is deactivating and re-applying constantly?
Does anyone have any idea how to get this working?
Two Versions of my code :
Event OnUpdate()
If ( DeathDone == 0 )
DeathDone = 1
Target.AddItem(ZSCorpseClothing01, 1)
Target.EquipItem(ZSCorpseClothing01)
EndIf
EndEvent
Event OnEffectFinish()
Target.AddItem(ZSCorpseClothing01, 1)
Target.EquipItem(ZSCorpseClothing01)
EndEvent
Target is defined elsewhere in the Script, and DeathDone is a float.