maybe you should change this "<=" to this ">=" because in your statement you need less then 20k points, don't know if you ment to do this
|
Im trying to get this to take dung points away after buying the item iv tried everything..
Code:if (componentId == 1) { if (player.getDungpoints() <= 20000) { player.setDungpoints(player.getDungpoints =- 20000); player.getInventory().addItem(18349, 1); end(); return; }
maybe you should change this "<=" to this ">=" because in your statement you need less then 20k points, don't know if you ment to do this
I need it to take points away after buying the item.
What are you actually trying to do?
Your code currently says the following:
If Player has 20.000 or more then 20.000 DP ->
Set DP to: current points =- 20.000 (This should be "player.getDungpoints + 20000" if you want to add 20k points) ->
Add 1x 18349 to player inventory ->
quit
I cant figure out how to make it take away points..
Edit: When i started writing my first post you didn't comment yet. That is why i asked you what you wanted to do.Code:if (componentId == 1) { if (player.getDungpoints() >= 20000) { player.setDungpoints(player.getDungpoints - 20000); player.getInventory().addItem(18349, 1); end(); return; }
Ye i tried that lol didnt work.
Edit:
going to try again.
What is the result?
Add me on skype, username: HolyDivinity
Could you run that instead of your code and show me the [DEV] messages ?Code:if (player.getDungpoints() >= 20000) { player.sm("[DEV] player has"+player.getDungpoints()+"DP's"); player.setDungpoints(player.getDungpoints() - 20000); player.sm("[DEV] DP set to"+player.getDungpoints()); player.getInventory().addItem(18349, 1); player.sm("[DEV] Added item"); return; } else { player.sm("[DEV] Player doesn't have >= 20.000 DP"); return; }
This is a 667 so things may be diffrent, cause i had no issues on my 718.
Code:@Override public void start() { npcId = (Integer) parameters[0]; sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "Would you like to view the Dungeoneering shop?" }, IS_NPC, npcId, 9827); } @Override public void run(int interfaceId, int componentId) { if (stage == -1) { sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] { player.getDisplayName(), "Yes please." }, IS_PLAYER, player.getIndex(), 9827); stage = 1; } else if (stage == 1) { sendDialogue(SEND_5_OPTIONS, "Choose an option", "Chaotic Rapier", "Chaotic Longsword", "Chaotic Maul", "Chaotic Crossbow", "Next page."); stage = 2; } else if (stage == 2) { if (componentId == 1) { if (player.getDungpoints() >= 20000) { player.getInventory().addItem(18349, 1); player.setDungpoints(player.getDungpoints + 20000); player.setDungpoints(player.getDungpoints - 2000); end(); return; }
Code:player.setDungpoints(player.getDungpoints -= 20000);
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |