Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. admin = "Bendittt"
  2. adminC = {Bendittt = 1}
  3. cash = {}
  4. item = {}
  5. particle = {}
  6.  
  7. function eventNewPlayer(pN)
  8. item[pN] = 0
  9. ui.addTextArea(1, "<a href = 'event:shop'>Shop!</a>", pN, 6, 25, 100, 20, 0x111111, 0x111111, 1, true)
  10. system.bindMouse(pN, true)
  11. if pN == admin then
  12. cash[pN] = 888888
  13. else
  14. cash[pN] = 100
  15. end
  16. ui.addTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  17. end
  18.  
  19. function eventLoop(eT, rT)
  20. for pN in pairs(tfm.get.room.playerList) do
  21. cash[pN] = cash[pN] + 1
  22. ui.updateTextArea(2, "You have "..cash[pN].." points", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  23. end
  24. end
  25.  
  26. function eventTextAreaCallback(id, pN, req)
  27. if req == "shop" then
  28. ui.addTextArea(1, "Shop!\n-> <a href = 'event:plank'>Plank - 10 points</a>\n-> <a href = 'event:largebox'>Large box - 40 points</a>\n-> <a href = 'event:spirit'>Spirit - 50 points</a>\n-> <a href = 'event:frogballoon'>Frog balloon - 90 points</a>", pN, 6, 25, 200, 85, 0x111111, 0x111111, 1, true)
  29. elseif req == "plank" then
  30. if cash[pN] >= 10 then
  31. cash[pN] = cash[pN] - 10
  32. item[pN] = 3 -- it's default plank id
  33. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  34. end
  35. elseif req == "largebox" then
  36. if cash[pN] >= 40 then
  37. cash[pN] = cash[pN] - 40
  38. item[pN] = 1
  39. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  40. end
  41. elseif req == "spirit" then
  42. if cash[pN] >= 50 then
  43. cash[pN] = cash[pN] - 50
  44. particle[pN] = 10
  45. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  46. end
  47. elseif req == "frogballoon" then
  48. if cash[pN] >= 90 then
  49. cash[pN] = cash[pN] - 90
  50. item[pN] = 2805
  51. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  52. end
  53. end
  54. end
  55.  
  56. function eventMouse(pN, x, y)
  57. if item[pN] > 0 then
  58. tfm.exec.addShamanObject(item[pN], x, y, 0, 0, 0, false)
  59. item[pN] = 0
  60. elseif particle[pN] > 0 then
  61. tfm.exec.displayParticle(particle[pN], x, y)
  62. particle[pN] = 0
  63. end
  64. end
  65.  
  66. function eventChatCommand(pN, c)
  67. if c == "disable" and adminC[pN] then
  68. system.exit()
  69. end
  70. end
  71.  
  72. for pN in pairs(tfm.get.room.playerList) do
  73. eventNewPlayer(pN)
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement