Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 KB | None | 0 0
  1. p = 0
  2.  
  3. function ui.addWindow(id, text, player, x, y, width, height, alpha)
  4. ui.addTextArea(id, "", player, x, y, width, height, 0x573926, 0x573926, alpha, true)
  5. ui.addTextArea(id.."0", "", player, x+1, y+1, width-2, height-2, 0x8a583c, 0x8a583c, alpha, true)
  6. ui.addTextArea(id.."00", "", player, x+3, y+3, width-6, height-6, 0x2b1f19, 0x2b1f19, alpha, true)
  7. ui.addTextArea(id.."000", "", player, x+4, y+4, width-8, height-8, 0xc191c, 0xc191c, alpha, true)
  8. ui.addTextArea(id.."0000", "", player, x+5, y+5, width-10, height-10, 0x2d5a61, 0x2d5a61, alpha, true)
  9. ui.addTextArea(id.."00000", text, player, x+5, y+6, width-10, height-12, 0x142b2e, 0x142b2e, alpha, true)
  10. end
  11.  
  12. ui.addWindow(10, "<font size='12'><p align='center'><a href='event:r'>Sorteio",nil,5, 28, 65, 30, 1, true)
  13. ui.addTextArea(11, "<font size='15'><J><b>59 queijos</b>", nil, 531, 50, 200, 100, 0x324650, 0x324650, 0, true)
  14.  
  15. isRoom = tfm.get.room.name:find("#")~=nil
  16. roomAdmin,winners = "",{}
  17. isRunning = false
  18.  
  19. do
  20. local chat,txtarea = tfm.exec.chatMessage,ui.addTextArea
  21. tfm.exec.chatMessage = function(...)
  22. if isRoom then
  23. chat(...)
  24. end
  25. end
  26. ui.addTextArea = function(...)
  27. --if not isRoom or ({...})[1]==3 or ({...})[1]==4 then
  28. txtarea(...)
  29. --end
  30. end
  31. end
  32.  
  33. for k,v in next,{"AutoShaman","AutoNewGame","AutoTimeLeft","AutoScore","AfkDeath","MortCommand","DebugCommand","PhysicalConsumables"} do
  34. tfm.exec["disable"..v]()
  35. end
  36.  
  37. table.random=function(t)
  38. return (type(t)=="table" and t[math.random(#t)] or math.random())
  39. end
  40.  
  41. choice = {1,true}
  42. block = {1,false}
  43. currentGift = 1
  44. total = 1
  45. eventNewGame = function()
  46. if isRunning then
  47. for i,x in next,{106,284,443} do
  48. tfm.exec.addPhysicObject(i,x,231,{
  49. type = 12,
  50. height = 40,
  51. width = 40,
  52. miceCollision = false,
  53. groundCollision = false,
  54. color = 0xCFCFBE
  55.  
  56. })
  57. end
  58. for i = 0,1 do
  59. ui.removeTextArea(i)
  60. end
  61. choice = {1,true}
  62. block = {1,false}
  63. currentGift = 1
  64. tfm.exec.setGameTime(1e7)
  65. end
  66. end
  67.  
  68. function sendMenu(id, player, text, x, y, width, height, alpha)
  69. ui.addTextArea(id..'0', '', player, x+-2, y+18, width+24, height+14, 0x2E221B, 0x2E221B, alpha)
  70. ui.addTextArea(id..'00', '', player, x+-1, y+19, width+22, height+12, 0x986742, 0x986742, alpha)
  71. ui.addTextArea(id..'000', '', player, x+2, y+22, width+16, height+6, 0x171311, 0x171311, alpha)
  72. ui.addTextArea(id..'0000', '', player, x+3, y+23, width+14, height+4, 0x0C191C, 0x0C191C, alpha)
  73. ui.addTextArea(id..'00000', '', player, x+4, y+24, width+12, height+2, 0x24474D, 0x24474D, alpha)
  74. ui.addTextArea(id..'000000', '', player, x+5, y+25, width+10, height+0, 0x183337, 0x183337, alpha)
  75. ui.addTextArea(id..'0000000', text, player, x+6, y+26, width+8, height+-2, 0x122528, 0x122528, alpha)
  76. ui.addTextArea(id.."00000000", "", player, x+10, y+height+10, width+0, 13, 0x7a8d93, 0x7a8d93, alpha, true)
  77. ui.addTextArea(id.."000000000", "", player, x+11, y+height+11, width+0, 13, 0xe1619, 0xe1619, alpha, true)
  78. ui.addTextArea(id.."0000000000", "", player, x+11, y+height+11, width-1, 12, 0x314e57, 0x314e57, alpha, true)
  79. ui.addTextArea(id.."00000000000", '<p align="center"><font size="12"><a href="event:fechar@'..id..'"><N>Fechar</a>', player, x+11, y+height+8, width+0, nil, 0x314e57, 0x314e57, 0, true)
  80. end
  81.  
  82. function closeMenu(id, player)
  83. for x = 15,0,-1 do
  84. id = id..'0'
  85. ui.removeTextArea(id, player)
  86. end
  87. end
  88.  
  89. function eventTextAreaCallback(id, player, callback)
  90. if callback == "r" then
  91. sendMenu(33, player,"<V><p align='center'><font size='30'>Informações do Sorteio</font></p>\n<font size='12'><N>• Bem-vindo ao sorteio! Para ganhar algum prêmio é necessário que apareça 3 imagens iguais nas máquinas caça-niqueís, que estão no mapa. Para jogar uma rodada você deve dar <J>2 queijos <N>ao organizador do sorteio, o <V>Ruamorangos<N>. Você pode jogar quantas vezes quiser!\n\n• Prêmios disponíveis no momento: Pele de Esqueleto, Pele de Vampiro, Bolas de Neve, <J>Jackpot<N> e <R>Morangos<N>.\n\n• Consumíveis: você ganha 10 unidades\n<J>• Jackpot = quantidade de queijos que está no canto direito encima do mapa.\n<R>• Morangos = aproximadamente 124 morangos.", 145,63,490,244, 1, true)
  92. print("<ROSE>".. player .." abriu a aba Sorteio.")
  93. elseif callback:sub(0,6) == 'fechar' then
  94. id = callback:sub(8)
  95. closeMenu(id, player)
  96. ui.removeTextArea(20, player)
  97. end
  98. end
  99.  
  100. eventPlayerLeft = function() p = p - 1 end
  101. eventNewPlayer = function(n) p = p + 1
  102. ui.addWindow(10, "<font size='12'><p align='center'><a href='event:r'>Sorteio",n,5, 28, 65, 30, 1, true)
  103. ui.addTextArea(11, "<font size='15'><J><b>59 queijos</b>", n, 531, 50, 200, 100, 0x324650, 0x324650, 0, true)
  104. if isRunning then
  105. else
  106. tfm.exec.respawnPlayer(n)
  107. updateTextAreas()
  108. end
  109. end
  110. for k,v in next,tfm.gent.room.playerList do p = p + 1 end
  111.  
  112. newGame = function()
  113. isRunning = true
  114. gifts = {
  115. [1] = table.random({9, 801, 12, 6, 800, 9, 12, 6}),
  116. [2] = table.random({800, 6, 9, 12, 9, 6, 12, 801}),
  117. [3] = table.random({12, 9, 12, 800, 6, 801, 6, 9, 800})
  118. }
  119. tfm.exec.newGame('<C><P DS="m;106,120,284,120,443,120" D="x_transformice/x_inventaire/'..gifts[1]..'.jpg,264,211;x_transformice/x_inventaire/'..gifts[2]..'.jpg,86,211;x_transformice/x_inventaire/'..gifts[3]..'.jpg,423,211;x_evenements/x_fondHalloweenMap2.jpg" /><Z><S><S X="750" L="50" o="ffffff" H="10" c="4" Y="345" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S X="750" L="55" o="6a7495" H="10" c="4" Y="325" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S X="720" L="10" o="6a7495" H="10" c="4" Y="330" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S X="780" L="10" o="6a7495" H="10" c="4" Y="330" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S X="750" L="80" o="6a7495" H="30" c="4" Y="345" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S X="720" L="10" o="6a7495" H="10" c="4" Y="360" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S X="780" L="10" o="6a7495" H="10" c="4" Y="360" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S X="750" L="55" o="6a7495" H="10" c="4" Y="365" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S X="750" L="20" o="ffffff" H="10" c="4" Y="345" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="ffffffff" X="400" Y="385" T="12" H="10" /><S L="660" o="ffffffff" X="331" H="10" Y="231" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="330" o="ffffffff" H="10" Y="115" T="12" X="245" /><S L="240" o="ffffffff" H="10" X="575" Y="115" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="30" o="ffffffff" X="17" Y="115" T="12" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ffffffff" H="400" Y="200" T="12" X="5" /><S L="10" o="ffffffff" H="400" X="795" Y="200" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="800" o="ffffffff" X="400" H="10" Y="15" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="370" X="400" /></D><O /><L><JR /></L></Z></C>')
  120. ui.addWindow(9, "",nil,10, 10, 10, 10, 10, true)
  121. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement