Jump to content

Need OnEquip help


Recommended Posts

I know that in the OnActivate block you can use getActionRef to determine who activated the effect, but how do i figure out who equipped an object? i want to keep npc's from activating my scripts in my spelltome mod.

scn SpellTome0001

short HasReadOnce

begin onActivate 
activate
if getActionRef == player
if HasReadOnce == 0
	message "Knowledge Gained"
	startquest QSpellTome0001
	set HasReadOnce to 1
       endif
endIf
end

begin onEquip  ;'[edit] i tried begin onEquip player and it compiles but it doesnt work in game'
;if getActionRef == player<--------need a working code equivalent here preferably non-OBSE
if HasReadOnce == 0
	message "Knowledge Gained"
	startquest QSpellTome0001
	set HasReadOnce to 1
endIf
endif
end

Edited by shadowsyllvet
Link to comment
Share on other sites

If it compiles as "begin onequip player" then it should only run when the player is the equipping ref. To make a check twice is redundant and a waste of processing power.
Link to comment
Share on other sites

"GetContainer" should work, because it will return the actor who is carrying the item. It's impossible for anyone to equip an item without carrying it, so it will work for you.

 

But theuseless was right. "Begin OnEquip Player" will make the script only run when the player equips the item. If you use it correctly, it should work perfectly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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