SandMouseAnarchy Posted May 20, 2020 Posted May 20, 2020 (edited) How do you use GetWornItem() on an NPC? is it even possible? This compiles for the player, so i thought that with a small edit it would work for an NPC too, sadly it doesn't ->Event OnActivate(objectreference akfurniture) Actor Player = Game.GetPlayer() Form Equipment = Player.GetWornItem(3).Item Player.equipItem(Equipment)"OnActivate()" can use "(objectreference akfurniture)" or "(objectreference akActionRef)"So i tried using akActionRef to reference the NPC.These examples won't compile, i've tried variations of both but none of them will compile either ->Event OnActivate(objectreference akActionRef) Actor NPC = akActionRef Form Equipment = NPC.GetWornItem(3).Item NPC.equipItem(Equipment) EndEventEvent Onactivate(objectreference akActionRef) Form Equipment = akActionRef.GetWornItem(3).Item akActionRef.equipItem(Equipment) EndEventAny ideas? Edited May 20, 2020 by SandMouseAnarchy
dylbill Posted May 20, 2020 Posted May 20, 2020 You need to cast the akActionRef as actor. : Event OnActivate(objectreference akActionRef) Actor NPC = akActionRef as actor Form Equipment = NPC.GetWornItem(3).Item NPC.equipItem(Equipment) EndEvent
SandMouseAnarchy Posted May 20, 2020 Author Posted May 20, 2020 Ah man I feel dumb now haha. Thankyou dylbill! That worked perfectly!
Recommended Posts