Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. admin = "Bendittt"
  2. points = {}
  3.  
  4.  
  5.  
  6. function eventNewPlayer(pN)
  7. ui.addTextArea(1, "<a href = 'event:shop'>Shop!</a>", pN, 6, 25, 100, 20, 0x111111, 0x111111, 1, true)
  8. system.bindMouse(pN, true)
  9. if pN == admin then
  10. cash[pN] = 888888
  11. else
  12. cash[pN] = 10
  13. end
  14. ui.addTextArea(2, "You have "..cash[pN].." Points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  15. end
  16.  
  17. function eventLoop(eT, rT)
  18. for pN in pairs(tfm.get.room.playerList) do
  19. cash[pN] = cash[pN] + 0.1
  20. ui.updateTextArea(2, "You have "..cash[pN].." Points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  21. end
  22. end
  23.  
  24. function eventTextAreaCallback(id, pN, req)
  25. if req == "shop" then
  26. ui.addTextArea(1, "Shop!\n-> <a href = 'event:meep'>Meep - 250 coins</a>\n-> <a href = 'event:vampire'>Vampire - 300 coins</a>\n-> <a href = 'event:shaman'>Shaman - 350 coins</a>\n-> <a href = 'event:color'>Random nick color - 750 coins</a>", pN, 6, 25, 200, 85, 0x111111, 0x111111, 1, true)
  27. elseif req == "meep" then
  28. if cash[pN] > 250 then
  29. cash[pN] = cash[pN] - 250
  30. tfm.exec.giveMeep(pN)
  31. ui.updateTextArea(2, "You have "..cash[pN].." coins!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  32. end
  33. elseif req == "vampire" then
  34. if cash[pN] > 300 then
  35. cash[pN] = cash[pN] - 300
  36. tfm.exec.setVampirePlayer(pN)
  37. ui.updateTextArea(2, "You have "..cash[pN].." coins!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  38. end
  39. elseif req == "shaman" then
  40. if cash[pN] > 350 then
  41. cash[pN] = cash[pN] - 350
  42. tfm.exec.setShaman(pN)
  43. ui.updateTextArea(2, "You have "..cash[pN].." coins!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  44. end
  45. elseif req == "color" then
  46. if cash[pN] > 750 then
  47. cash[pN] = cash[pN] - 750
  48. tfm.exec.setNameColor(pN, string.format("%x", math.random(0xFFFFFF, 0xFFFFFF)))
  49. ui.updateTextArea(2, "You have "..cash[pN].." coins!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  50. end
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement