roguehippo Posted January 7, 2017 Share Posted January 7, 2017 Hello, i was just wondering how i would initialize a Store variable. after i trade him do i just do 'Store storename = new Store();"? how do i get it to use the correct one Quote Link to comment Share on other sites More sharing options...
wwwat Posted January 7, 2017 Share Posted January 7, 2017 Isn't it just getStore()? Then you can do getStore().buy() or whatever. Quote Link to comment Share on other sites More sharing options...
WiseGoldMan Posted January 7, 2017 Share Posted January 7, 2017 What is the end goal here? What are you trying to do? Quote Link to comment Share on other sites More sharing options...
Juggles Posted January 7, 2017 Share Posted January 7, 2017 (edited) NPC storeKeeper = getNpcs.closest("Name"); if (!getStore.isOpen) { if (storeKeeper!=null) { storeKeeper.interact("Trade"); } }else { getStore.buy("item",amount); } Edited January 7, 2017 by Juggles 1 Quote Link to comment Share on other sites More sharing options...
Team Cape Posted January 7, 2017 Share Posted January 7, 2017 Hello, i was just wondering how i would initialize a Store variable. after i trade him do i just do 'Store storename = new Store();"? how do i get it to use the correct one It looks like you're trying to cache the items that are held in the store. Just do Item[] cachedStoreItems = getStore().getItems() Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted January 7, 2017 Share Posted January 7, 2017 The Store variable is in the client, you don't have to declare and initialize it yourself. You could just do Script#getStore() 2 Quote Link to comment Share on other sites More sharing options...
roguehippo Posted January 7, 2017 Author Share Posted January 7, 2017 The Store variable is in the client, you don't have to declare and initialize it yourself. You could just do Script#getStore() thank you i didnt know this. solved my problem Quote Link to comment Share on other sites More sharing options...