CameronFitzy

Points Message

Dec 16th, 2020 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MessageData=Info[0].replace(`=`,`%20`).split(`%20`);
  2. PlusMinus=MessageData[2];
  3. PlusMinusTotal=MessageData[3];
  4. Message=Info[1];
  5. ItemName=Info[2];
  6. TotalReward=Info[3];
  7. ShopItems=``;
  8. ShopItemsPrice=``;
  9.  
  10. R=`If you see this your not supposed to.`;
  11.  
  12. for(x in Settings.Shop.Items)
  13. {ShopItems+=`,`+x};
  14. ShopList=ShopItems.toLowerCase().slice(1).split(`,`);
  15. ShopListU=ShopItems.slice(1).split(`,`);
  16.  
  17. for(a in Settings.Shop.Items)
  18. {ShopItemsPrice+=` | `+Settings.Shop.Items[ShopListU[ShopListU.indexOf(a)]].Name+`-`+Settings.Shop.Items[ShopListU[ShopListU.indexOf(a)]].Price};
  19. ShopListW=ShopItemsPrice.slice(3);
  20.  
  21. if(Message==`Description`)
  22. {R=`${Settings.Shop.Items[ShopListU[ShopList.indexOf(ItemName)]].Name} || Price: ${Settings.Shop.Items[ShopListU[ShopList.indexOf(ItemName)]].Price} | BuyLimit: ${Settings.Shop.Items[ShopListU[ShopList.indexOf(ItemName)]].BuyLimit==0?`Infinity`:Settings.Shop.Items[ShopListU[ShopList.indexOf(ItemName)]].BuyLimit} | Description: ${Settings.Shop.Items[ShopListU[ShopList.indexOf(ItemName)]].Description}`};
  23.  
  24. if(Message==`ItemList`)
  25. {R=`The items in the shop are: ${ShopListW}`};
  26.  
  27. if(Message==`Points`)
  28. {R=`You have ${TotalReward} points.`};
  29.  
  30. if(Message==`Help`)
  31. {R=`Possible arguments are (Help,Shop,Points,Buy,{Item Name})`};
  32.  
  33. if(Message==`BuySuccess`)
  34. {R=`You bought ${ItemName} for ${PlusMinus==`Plus`?`-`:``}${PlusMinusTotal}!`};
  35.  
  36. if(Message==`TooMany`)
  37. {R=`You can only buy ${Settings.Shop.Items[ShopListU[ShopListU.indexOf(ItemName)]].BuyLimit} of those.`};
  38.  
  39. if(Message==`BuyFail`)
  40. {R=`That costs ${Settings.Shop.Items[ShopListU[ShopListU.indexOf(ItemName)]].Price} and you only have ${TotalReward}.`};
  41.  
  42. if(Message==`BuyFail`)
  43. {R=`${ItemName==`NoItem`?`Please put an items name after “buy”`:`Sorry there is no “${ItemName}in the shop`}`};
  44.  
  45. if(Message==`Error`)
  46. {R=`Please contact next if you see this`};
  47.  
  48. R
Add Comment
Please, Sign In to add comment