maniczombie Posted June 28, 2012 Share Posted June 28, 2012 I'm making a script that's run from an object reference when it is equipped. What is the NPC equivalent to Game.GetPlayer() Also can the OnEquip event be used on NPCs? Thanks Link to comment Share on other sites More sharing options...
mojodajojo Posted June 28, 2012 Share Posted June 28, 2012 If you're attaching a script directly to an npc you can just use self Example: Self.DoSomethingHere() And yes OnEquipped should work on NPCs. Link to comment Share on other sites More sharing options...
maniczombie Posted June 28, 2012 Author Share Posted June 28, 2012 Ah thanks that should work for what I'm doing Link to comment Share on other sites More sharing options...
maniczombie Posted June 29, 2012 Author Share Posted June 29, 2012 OnEquipped didn't work out great as it caused the npc to continue to equip an item when unsheathing there weapon. I switched it too Event OnItemAdded Would I be able to detect what helmet the npc is wearing in function as an if statement such as if "Game.GetSelf().IsEquipped(IronHelmet)"? Link to comment Share on other sites More sharing options...
mojodajojo Posted July 3, 2012 Share Posted July 3, 2012 If you're talking about a script on a particular npc I'd imagine you could do If Self.IsEquipped(IronHelmet)EndIf What are you trying to do in your script? Link to comment Share on other sites More sharing options...
maniczombie Posted July 3, 2012 Author Share Posted July 3, 2012 Doesn't matter anymore sorry, I've fixed the script, working fine now =) Link to comment Share on other sites More sharing options...
Recommended Posts