InFocus Posted October 4, 2018 Posted October 4, 2018 Hi friends, i add voicecommand with custom locations and i want to know what line i need for Noblesse can teleport in zone? I try with activeChat.isNoble() but doesn't work.
0 'Baggos' Posted October 4, 2018 Posted October 4, 2018 (edited) Try this one. if (command.startsWith("easy")) { if (!activeChar.isNoble()) { activeChar.sendMessage("Only Noblesse players can teleport."); return; } else { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); activeChar.teleToLocation(89006, 27373, -15691); activeChar.sendMessage("You have teleported to easy farm zone"); _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } } Edited October 4, 2018 by 'Baggos' 1
0 'Baggos' Posted October 4, 2018 Posted October 4, 2018 1 hour ago, InFocus said: Hi friends, i add voicecommand with custom locations and i want to know what line i need for Noblesse can teleport in zone? I try with activeChat.isNoble() but doesn't work. Before the code for teleport put a check if (command.equals("teleportTo")) { if (!activeChar.isNoble()) activeChar.sendMessage("Only Noblesse players can teleport."); activeChar.teleToLocation(list, 0); activeChar.sendMessage("You have been teleported to " + list + "."); }
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 Good job 'Baggos' i have a bit complicated code. Every zone is independent. I must add isNoble for each other. Or i don't know if i can make it for all. This is for 1 zone if (command.startsWith("easy")) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); activeChar.teleToLocation(89006, 27373, -15691); activeChar.sendMessage("You have teleported to easy farm zone"); _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } This is one. I have 3 more this config with 3 different zones. So i need the parameters for all in one
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 I did now like that if (command.startsWith("easy")) { if (!activeChar.isNoble()) { activeChar.sendMessage("Only Noblesse players can teleport."); } activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); activeChar.teleToLocation(89006, 27373, -15691); activeChar.sendMessage("You have teleported to easy farm zone"); _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } and i no have Noble status and work teleport. I want without noblesse, do not teleport :)
0 InFocus Posted October 4, 2018 Author Posted October 4, 2018 Thank you! it is working ! Solved. Can close topic ! Thanks to 'Baggos'
0 SweeTs Posted October 4, 2018 Posted October 4, 2018 11 hours ago, InFocus said: nd i no have Noble status and work teleport. I want without noblesse, do not teleport Then code with open eyes and active brain. If you check your code, you ONLY added a message. Why it's still processing the code? Bcs you did NOT add the return.
Question
InFocus
Hi friends, i add voicecommand with custom locations and i want to know what line i need for Noblesse can teleport in zone? I try with activeChat.isNoble() but doesn't work.
6 answers to this question
Recommended Posts