nvm sorry man
|
well i used a tutorial i found on here and i made gambling into a command, with a few changes for the better, i have this so far,i need help so if you dont have the initial 500k, the command wont work, anyone help please?Code:if (command.startsWith("gamble")) { deleteItem(995, getItemSlot(995), 500000); if(misc.random(2) == (1)){ sendMessage("You win 500k!"); addItem(995, 1000000); } else sendMessage("Sorry, you lost your money!"); }
Code:if (command.startsWith("gamble")) { if(playerHasItemAmount(995, 500000)) { deleteItem(995, getItemSlot(995), 500000); if(misc.random(2) == (1)){ sendMessage("You win 500k!"); addItem(995, 1000000); } else { sendMessage("Sorry, you lost your money!"); } } else { sendMessage("You do not have the money to gamble."); } }
Hope it helps
--Stu
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |