player.sendMessage("");
|
|
How i can send a Local message if someone gets a Santa hat from the box?
This is atm my message for the player.
![]()

player.sendMessage("");
I want to send a world message if the player gets like santa hat.. not that

ok. i must edit it much but its work now.
other problem on it, randomly it dont gives you a item but i add all right?
Like here i got 23/28 items.
Code:} else if(itemId == 18768) { int[] RandomReward = {28002, 15443, 15444, 15442, 15441, 111694, 13740, 13742, 13738, 13744, 1050, 1038, 1040, 1042, 1044, 1046, 1048}; player.getInventory().deleteItem(18768, 1); int i = Utils.getRandom(RandomReward.length); int items = RandomReward[i]; String name = ItemDefinitions.getItemDefinitions(items).getName(); player.getInventory().addItem(items, 1); player.getPackets().sendGameMessage("You open the mystery box and find..."+name+"!");
Code:if (itemId == 18768) { int[] randomItems = {28002, 15443, 15444, 15442, 15441, 111694, 13740, 13742, 13738, 13744, 1050, 1038, 1040, 1042, 1044, 1046, 1048}; int i = Utils.getRandom(randomItems.length); player.getInventory().deleteItem(18768, 1); player.getInventory().addItem(randomItems[i], 1); String reward = ItemDefinitions.getItemDefinitions(randomItems[i]).getName().toLowerCase(); player.getInventory().addItem(1, 1); World.sendWorldMessage("" + player.getDisplayName() + " <col=008CFF> has just received a <col=008CFF>"+ reward + " from a mystery box!</col>", false); return;
This is the same just edit the message and others i get errors lol.

You're going to have to edit it a little bit, but it works. E.G. edit the id's and edit the message.Code:if (itemId == 6199) { int[] RandomItems = {11732, 4151, 11283, 385, 2347, 1712, 1712, 6585, 1712, 6585, 11732, 11732, 3105, 6918, 6920, 6922, 6924, 6570, 10828, 1079, 1127, 20072, 20072, 8850, 10551, 10548, 4087, 15332, 15332, 4712, 4714, 4716, 4718, 4720, 4722, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 6585, 5698, 1704, 7378, 7370, 7390, 6737, 6731, 6733, 11716, 6199, 6199, 7386, 7394, 11846, 11850, 11852, 2673, 2669, 2671, 6889, 6914, 2653, 2655, 2657, 1837, 10330, 11848, 11854, 11856, 10332, 10334, 10336, 542, 4087, 4585, 6568, 6568, 10338, 10340, 10342, 10344, 10346, 10348, 10350, 10352, 2581, 13736, 6916, 6918, 6920, 6922, 6924, 3481, 3483, 3486, 2577, 2665, 10452, 10454, 10456, 9470, 2661, 10450, 10446, 10448, 1037, 14595, 14603, 1050, 23679, 23680, 23681, 23682, 23683, 23684, 23685, 23686, 23687, 23688, 23689, 23690, 23691, 23692, 23693, 23694, 23695, 23696, 23697, 23698, 23699, 23700, 1040, 1042, 1044, 1046, 1048, 1050, 1053, 1055, 1057, 11732, 3105, 1712, 1704, 1706, 1079, 1127, 6585, 6570, }; //Other ids go in there as well player.getInventory().deleteItem(6199, 1); int i = Utils.getRandom(148); //Number of randomItems player.getInventory().addItem(RandomItems[i], 1); player.getPackets().sendGameMessage("You've received an item from the Mystery Box!"); return; }
| « NPC Animations | RuneLove Error Giving Thanks and Rep. » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |