Zeldaboy111

Signs ]|[ Skript #431

Jul 9th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. options:
  2. prefix: &6Tycoon&8:&7
  3.  
  4. function sendBalance():
  5. if {tc.loopingBalance} is true:
  6. stop
  7. set {tc.loopingBalance} to true
  8. while {tc.loopingBalance} is true:
  9. if {tc.stopped} is true:
  10. delete {tc.loopingBalance}
  11. if size of online players is 0:
  12. delete {tc.loopingBalance}
  13. else:
  14. loop all players:
  15. send actionbar "&6Coins&8: &e%{tc.%uuid of loop-player%.balance}%" to loop-player
  16. wait 40 ticks
  17. on join:
  18. if {tc.%uuid of player%.balance} is not set:
  19. set {tc.%uuid of player%.balance} to 0
  20. sendBalance()
  21.  
  22. on enable:
  23. while {tc.loopingBalance} is true:
  24. wait 10 ticks
  25. if {tc.stopped}:
  26. sendBalance()
  27. delete {tc.stopped}
  28.  
  29. on disable:
  30. if {tc.loopingBalance} is true:
  31. set {tc.stopped} to true
  32.  
  33. function setLineData(sign: Location, line: String, firstType: String, secondType: String):
  34. set {_lines::*} to {_line} split at " "
  35. if size of {_lines::*} is not 2:
  36. stop
  37.  
  38. set {_firstValue} to {_lines::1} parsed as an integer
  39. set {_secondValue} to {_lines::2} parsed as an integer
  40. if {_firstValue} is set:
  41. if {_secondValue} is set:
  42. if {_firstValue} > 0:
  43. if {_secondValue} > 0:
  44. set {tc.signdata.%{_sign}%.%{_firstType}%} to {_firstValue}
  45. set {tc.signdata.%{_sign}%.%{_secondType}%} to {_secondValue}
  46.  
  47. on sign change:
  48. if line 1 is not "Tycoon":
  49. stop
  50. setLineData(location of event-block, line 3 of event-block, "cost", "costIncrease")
  51. setLineData(location of event-block, line 4 of event-block, "level", "maxLevel")
  52. if {tc.signdata.%location of event-block%.cost} is not set:
  53. stop
  54. set line 1 to "&6&l%line 2%"
  55. set line 2 to ""
  56. set line 3 to "&eCost&8: &7%{tc.signdata.%location of event-block%.cost}%"
  57. set line 4 to "&bLevel&8: &7%{tc.signdata.%location of event-block%.level}%"
  58.  
  59. on right click on sign:
  60. if {tc.signdata.%location of event-block%.cost} is not set:
  61. stop
  62. else if {tc.signdata.%location of event-block%.level} >= {tc.signdata.%location of event-block%.maxLevel}:
  63. # play sound
  64. stop
  65.  
Advertisement
Add Comment
Please, Sign In to add comment