SandMouseAnarchy Posted May 20, 2020 Share 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) EndEvent Event Onactivate(objectreference akActionRef) Form Equipment = akActionRef.GetWornItem(3).Item akActionRef.equipItem(Equipment) EndEvent Any ideas? Edited May 20, 2020 by SandMouseAnarchy Link to comment Share on other sites More sharing options...
dylbill Posted May 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
SandMouseAnarchy Posted May 20, 2020 Author Share Posted May 20, 2020 Ah man I feel dumb now haha. Thankyou dylbill! That worked perfectly! Link to comment Share on other sites More sharing options...
dylbill Posted May 20, 2020 Share Posted May 20, 2020 No prob, happy modding! Link to comment Share on other sites More sharing options...
Recommended Posts