Then once the person receives the item from the NPC just change it to true and check to see if it is true. If it is, don't give the item. That simple.Code:public boolean givenItem = false;
|
|

Well I want to make an npc give an item to all players when they talk to him, but i want it so they can only get it off the npc once, even if they lose it, they cant get it back.
Thanks
Will rep if works
edit: using devo 2.7![]()

Then once the person receives the item from the NPC just change it to true and check to see if it is true. If it is, don't give the item. That simple.Code:public boolean givenItem = false;


or you could add one of the million things delta has xD - in the player file![]()


I'm assuming this is in client.java so ...add that boolean I told you about before at the top of the file somewhere then change your coding to this:
Code:if(NPCID == 500) { if(givenItem) { sendMessage("You have already received the item!"); } else { addItem(995, 1); givenItem = true; } }



| « ClickAble Url's Help!? | Weird error for multi barrage/burst rep++ » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |