Jump to content

Needing scripting Help Please


BisquitsNgravy

Recommended Posts

I am trying to find an example object script which will cast or cause the player to cast a spell when the object is added to the player or equipped on the player.

 

I have a mod I am trying to modify to cast a spell at a certain thresh hold. I have managed to get it to add various items to the player as tokens. I have tried adding clothing items and equipping them.

 

The spell works fine when I manually add it to the player and cast it so I know the spell works. But I can not get the player to cast the spell with an activator or even with a ring added and equipped, That is the latest thing I have tried.

 

This sounds so simple but I just cannot get it to work.

 

 

 

 

 

 

 

**scn Equipedringscript**

 

short isEquipped

 

begin onEquip player

set isEquipped to 1

 

player.addspell 02014faa

player.Cast 02014faa player

 

End

 

 

 

Link to comment
Guest Donkey

Cursedarmor should have samples like this. Also i think i created something similar but that was long time ago where you will be able to milk your breast and an animation would play then a new item will be added to your inventory. But i deleted most of my other stuff from my pc to save space.

 

I am not sure, but instead of begin onEquiped did you try: begin onAdd instead ??

 

 

**scn Equipedringscript**

 

short isEquipped

 

begin onEquip player

set isEquipped to 1

 

player.addspell 02014faa

player.Cast 02014faa player

 

End

 

 

How are you forcing it to be equiped on the player after it is added in ?? In the context above it will only work if you go to your inventory and use the item yourself.

Link to comment

Did a bit of testing and reading on this.

If the player equips the ring themselves, it will not do the cast.

If the ring is hotkeyed, it works fine.

So if player is in menumode when the onequip runs... no casting.

 

 

 

scn Equipedringscript

 

ref bucket

 

begin onEquip player

set bucket to GetContainer

if bucket.HasSpell MemRingTestSpell == 0

bucket.addspell MemRingTestSpell

endif

SelectPlayerSpell MemRingTestSpell

PrintToConsole "Tap it!"

TapControl 7

End

 

 

 

Might have the same problem with onadd if player takes it from a container.

If you force the equip from another script, be sure to use OBSEs EquipItem2 to insure the OnEquip block runs.

 

Mem

Link to comment
  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use