Juggles 18 Share Posted April 7, 2016 How would I go about doing this?I have (getNPC).closest("Name").interact("Use") but im not sure how to select the item first. Link to comment Share on other sites More sharing options...
IcCookies 24 Share Posted April 7, 2016 To select the item, do getInventory().interact("Item name"); Link to comment Share on other sites More sharing options...
Juggles 18 Author Share Posted April 7, 2016 To select the item, do getInventory().interact("Item name"); Thank you! Link to comment Share on other sites More sharing options...
Hashtag 8774 Share Posted April 7, 2016 Hey, I believe there is method called useOn(entity) in the inventory class. Link to comment Share on other sites More sharing options...
IcCookies 24 Share Posted April 7, 2016 Thank you! No problem, anytime. Link to comment Share on other sites More sharing options...
Juggles 18 Author Share Posted April 7, 2016 Whole script is coded, just need this last part still getInventory().getItemInSlot(2).useOn("NPC"); I thought this would select the item in the second slot and use it on the NPC but that doesnt work. Am I doing it incorrectly? Link to comment Share on other sites More sharing options...
Dreamlicker 750 Share Posted April 8, 2016 Whole script is coded, just need this last part still getInventory().getItemInSlot(2).useOn("NPC"); I thought this would select the item in the second slot and use it on the NPC but that doesnt work. Am I doing it incorrectly? That is technically the 3rd slot of the inventory, as the inventory is an array. This means the first slot is 0 and the last is 27. Link to comment Share on other sites More sharing options...
Calle 17 Share Posted April 8, 2016 That is technically the 3rd slot of the inventory, as the inventory is an array. This means the first slot is 0 and the last is 27. or in other terms getInventory().getItemInSlot(1).useOn("NPC"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.