Advertisement
Guest User

Coins.sk

a guest
Jan 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. options:
  2. id: N/A # this will be set by me when you submit your extension if it is accepted!
  3. sdk-build: 0.1-SNAPSHOT
  4. name: Coins # you may specify a name here if you like
  5. description: Fully made coins extension # you may describe your extension here if you like
  6. requireCheats: true # set it to false if it's something that should not require cheats, example a chat tag system
  7. creditCost: 10 # charge credits for this extension?
  8. dependencies: {"depend":[{"id":"90a14f"}]} # specify a list of dependencies using a JSON array. The default for this is just requiring the latest version of the FreeRealms SDK (forced installed). You do not need to change this. However, if you want to require RealmGroupManager (you need to do this for any RealmGroupManager functions on the docs), you need to change this!
  9. # example dependencies with added requirement of RealmGroupManager: {"depend":[{"id":"90a14f"},{"id":"5fb41c"}]}
  10.  
  11. # Brief details:
  12. # This file is just a temple to help you get started developing extensions using the FreeRealms SDK.
  13. # The FreeRealms SDK contains many useful functions and other resources to make scripting for us incredibly simple.
  14. # Example: Need to get the online players of a realm? Just use something like this for a /list command for example:
  15. # command /list:
  16. # trigger:
  17. # set {_players} to sdkGetRealmPlayers(event-player)
  18. # send "there are %{_players}% connected to this realm"
  19. # you will notice many FreeRealms SDK elements are requiring a player input (referenced by the %p argument structure)
  20. # this is because most of these effects are designed to be trigger by a player, example by use of a command, so we
  21. # use this to target the realm of the executing player, or whatever player is passed as an argument.
  22.  
  23. # DO NOT REMOVE THE BELOW CODE
  24.  
  25. on load:
  26. setDependencies("{@id}", "{@dependencies}")
  27.  
  28. # You may begin your code below this line
  29.  
  30. event "on realm join":
  31. if {coins::%uuid of player%} isn't set:
  32. set {coins::%uuid of player%} to 0
  33.  
  34. command /coins [<text>] [<offlineplayer>] [<number>]:
  35. trigger:
  36. set {_hasperm} to rgmGetPerm(coin.admin, %player%)
  37. if arg-1 is "set":
  38. if arg-3 < 0:
  39. send "&8[&6Coins&8] &7You may not set a users coin balance to anything less than 0." to player
  40. else if arg-3 > 0:
  41. set {coins::%uuid of arg-2%} to arg-3
  42. send "&8[&6Coins&8] &7You have set &6%arg-2%'s &7coin balance to &6%arg-3%" to player
  43. else if arg-1 is "add" or "give":
  44. if arg-3 <= 0:
  45. send "&8[&6Coins&8] &7You may not add less than or equal to 0 coins to &6%arg-2%'s &7coin balance." to player
  46. else if arg-3 > 0:
  47. add arg-3 to {coins::%uuid of arg-2%}
  48. send "&8[&6Coins&8] &7You have added &6%arg-3% coins &7to &6%arg-2%'s &7coin balance." to player
  49. else if arg-1 is "remove" or "take":
  50. if arg-3 <= 0:
  51. send "&8[&6Coins&8] &7You can not remove anything less than or equal to 0 from &6%arg-2%'s &7coin balance." to player
  52. else if arg-3 >= 1:
  53. remove arg-3 from {coins::%uuid of arg-2%}
  54. send "&8[&6Coins&8] &7You have removed &6%arg-3% coins &7from &6%arg-2%'s &7coin balance." to player
  55. else if arg-1 is "reset":
  56. set {coins::%uuid of arg-2%} to 0
  57. send "&8[&6Coins&8] &7You have reset &6%arg-2%'s &7coin balance." to player
  58.  
  59. command /coin [<player>]:
  60. trigger:
  61. if arg-1 isn't set:
  62. if {coins::%uuid of player%} isn't set:
  63. set {coins::%uuid of player%} to 0
  64. send "&8[&6Coins&8] &6Your &7Balance: &6%{coins::%uuid of player%}%" to player
  65. else:
  66. send "&8[&6Coins&8] &6Your &7Balance: &6%{coins::%uuid of player%}%" to player
  67. else if arg-1 is set:
  68. if {coins::%uuid of arg-1%} isn't set:
  69. set {coins::%uuid of arg-1%} to 0
  70. send "&8[&6Coins&8] &6%arg-1%'s &7Balance: &6%{coins::%uuid of arg-1%}%" to player
  71. else:
  72. send "&8[&6Coins&8] &6%arg-1%'s &7Balance: &6%{coins::%uuid of arg-1%}%" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement