Advertisement
Dudugz-Contistente

Untitled

Jan 3rd, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.17 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame()
  2. tfm.exec.disableAutoShaman()
  3. tfm.exec.disableAutoTimeLeft()
  4. tfm.exec.disableAutoScore()
  5.  
  6. colors = {
  7. bar = 0x696969,
  8. hot_unselected = 0x7a7a7a,
  9. hot_selected = 0x878787
  10. }
  11.  
  12. ids = {}
  13. data={}
  14.  
  15. shop = {
  16. {n="Varinha",img="1596513dd70.png",price=10,dmg=5},
  17. {n="Taco de baseball",img="1596513ff8c.png",price=32,dmg=7},
  18. {n="Taco de golf",img="159651429a0.png",price=56,dmg=9},
  19. {n="Espada",img="15965145722.png",price=78,dmg=12},
  20. {n="Picareta",img="15965148ea9.png",price=122,dmg=15},
  21. {n="Machado",img="1596514b69b.png",price=143,dmg=18},
  22. {n="Pé de cabra",img="1596514d4d6.png",price=168,dmg=27},
  23. }
  24.  
  25. keys = {48,49,50,51,52,53,54,55,56,57}
  26.  
  27. local npcs={}
  28. local time_spawn = os.time();
  29. local p = {}
  30.  
  31. local mapas = {"@6978537",'<C><P L="3000" D="x_deadmeat/x_zone/x_200.jpg,1541,-461;x_deadmeat/x_campement/repos_fond.jpg,-378,-280" Ca="" /><Z><S><S L="3000" H="10" X="1457" Y="404" T="14" P="0,0,0.3,0.2,0,0,0,0" /><S L="3000" X="1" H="10" Y="316" T="14" P="0,0,0,0,90,0,0,0" /></S><D /><O /></Z></C>'}
  32.  
  33. local zombies={
  34. {"15922b9ad4d.png", "15923a3e2d4.png", 115, 23, 92, "Zombie", 20, 3,2},
  35. {"159237ccbfd.png", "15923a3555b.png", 115, 23, 92, "Zombie", 30, 6,5},
  36. {"159237ce30f.png", "15923a37f86.png", 115, 23, 92, "Zombie", 40, 12,7},
  37. {"159238d77a9.png", "15923a3a9a7.png", 50, 23, 25, "Drekke", 60, 18,9},
  38. {"15927206568.png", "15927208310.png", 50, 21, 42,"Ghost", 80, 10,12}
  39. }
  40.  
  41. function eventChatMessage(name,cmd)
  42. if cmd == "!help" then
  43. ui.addTextArea(52,"<p align='center'><J><font size='15'><B>Como jogar...",name,148,77,504,22,nil,0x324645,nil,true,true)
  44. ui.addTextArea(53,"<font size='13'><p align='center'><R><B><a href='event:close'>Fechar</a>",name,152,352,496,20,0x1a2b30,0x1a2b30,nil,true,true)
  45. ui.addTextArea(54,"<B><I><font size='13'>Os <BV>ratos</BV> devem matar os <G>zumbis</G> mas cuidado!! temos outros <VP>monstros</VP> além de <G>zumbis</G> então preste muita atenção pois alguns deles tem muita <font color='#ff0000'>vida</font> e <VI>força</VI>, mate-os com vontade apertando <V>espaço</V> e ganhe <J>moedas</J> para comprar armas melhores.<BR>agora vou ensina-los a usar o inventário: Compre um item e selecione um item(utilizando as setinhas na janela do inventário) e depois pressione o numero do slot que você quer que ele seja equipado e pronto. você já tem ele na sua barra de itens selecionados. ",name,152,112,497,228,0x0b161c,0x0b161c,nil,true)
  46. end
  47. end
  48.  
  49. textarea=ui.addTextArea
  50. function ui.addTextArea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss,black_marcation,ground_marcation)
  51. --if not backgroundColor then backgroundColor=0x324650 end
  52. --if not borderColor then borderColor=0x000001 end
  53. if black_marcation then
  54. textarea(6969+id,"",targetPlayer,x,y+1,width,height,0x000001,0x000001,backgroundAlpha,emboss)
  55. end
  56.  
  57. if ground_marcation then
  58. textarea(7979+id,"",targetPlayer,x,y-1,width,height,0x6A8FA2,0x6A8FA2,backgroundAlpha,emboss)
  59. end
  60. textarea(id,text,targetPlayer,x,y,width,height,backgroundColor,borderColor,backgroundAlpha,emboss)
  61. end
  62.  
  63. function eventNewPlayer(name)
  64. eventChatMessage(name,"!help")
  65. p[name]={
  66. damage=5,
  67. delete="",
  68. delete2="",
  69. tempo = os.time(),
  70. life = 50,
  71. maxLife = 50,
  72. img = '',
  73. hot_selected = {1,152,"15926ee8777.png"},
  74. hot_items = {},
  75. coins = 0,
  76. images_grid = {},
  77. inventory = {},
  78. id = 1,
  79. select_x = 600,
  80. itm_selected = {},
  81. inv = false
  82. }
  83.  
  84. table.insert(p[name].inventory,{n="Faca",dmg=3,img="15926ee8777.png"})
  85.  
  86. for i,v in pairs(data) do
  87. if v[1] == name then
  88. p[name] = v[2]
  89. end
  90. end
  91.  
  92. table.insert(data,{name, p[name]})
  93.  
  94. p[name].hot_items[0]={img="",dmg=0}
  95. p[name].hot_items[1]={img="15926ee8777.png",dmg=3}
  96. p[name].hot_items[2]={img="",dmg=0}
  97. p[name].hot_items[3]={img="",dmg=0}
  98. p[name].hot_items[4]={img="",dmg=0}
  99. p[name].hot_items[5]={img="",dmg=0}
  100. p[name].hot_items[6]={img="",dmg=0}
  101. p[name].hot_items[7]={img="",dmg=0}
  102. p[name].hot_items[8]={img="",dmg=0}
  103. p[name].hot_items[9]={img="",dmg=0}
  104.  
  105. ui.addTextArea(-1,"",name,150,28,500,35,colors.bar,colors.bar,80,true)
  106. ui.addTextArea(0,"<p align='left'><font color='#000000'>0",name,609,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  107. ui.addTextArea(1,"<p align='left'><font color='#000000'>1",name,152,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  108. ui.addTextArea(2,"<p align='left'><font color='#000000'>2",name,203,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  109. ui.addTextArea(3,"<p align='left'><font color='#000000'>3",name,254,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  110. ui.addTextArea(4,"<p align='left'><font color='#000000'>4",name,305,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  111. ui.addTextArea(5,"<p align='left'><font color='#000000'>5",name,355,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  112. ui.addTextArea(6,"<p align='left'><font color='#000000'>6",name,406,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  113. ui.addTextArea(7,"<p align='left'><font color='#000000'>7",name,457,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  114. ui.addTextArea(8,"<p align='left'><font color='#000000'>8",name,508,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  115. ui.addTextArea(9,"<p align='left'><font color='#000000'>9",name,558,30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  116.  
  117. ui.addTextArea(p[name].hot_selected[1],"<p align='left'><font color='#ffffff'>"..p[name].hot_selected[1],name,p[name].hot_selected[2],30,40,32,colors.hot_selected,colors.hot_unselected,80,true)
  118. tfm.exec.setPlayerScore(name, 0, false)
  119. n = name
  120.  
  121. hot_update(name);
  122. ui.addTextArea(50,"<p align='center'><VI><a href='event:shop'><B><I>Loja</a>",name,720,338,70,20,nil,0x324645,nil,true,true)
  123. ui.addTextArea(58,"<p align='center'><VI><a href='event:inv'><B><I>Inventário</a>",name,720,370,70,20,nil,0x324645,nil,true,true)
  124. system.bindKeyboard(name,32,true,true) system.bindKeyboard(name,37,true,true) system.bindKeyboard(name,39,true,true)
  125. system.bindKeyboard(name,48,true,true) system.bindKeyboard(name,49,true,true) system.bindKeyboard(name,50,true,true)
  126. system.bindKeyboard(name,51,true,true) system.bindKeyboard(name,52,true,true) system.bindKeyboard(name,53,true,true)
  127. system.bindKeyboard(name,54,true,true) system.bindKeyboard(name,55,true,true) system.bindKeyboard(name,56,true,true)
  128. system.bindKeyboard(name,57,true,true) system.bindKeyboard(name,37,true,true) system.bindKeyboard(name,39,true,true)
  129.  
  130. lifeBar(name)
  131. tfm.exec.chatMessage("<CE>Bem-vindo ao Dead Challenge</CE><br><J>Reporte bugs á Rianmojang e Contistente, este minigame está em construção ainda.</J><BR><V>[Contistente]</V> <N>Todos os dados deste minigame são salvos temporáriamente, se acontecer um reset ou a sala esvaziar os dados são deletado, a e aos novos jogadores sejam bem-vindos, !help para mais informações</N>.",name)
  132. end
  133.  
  134. function hot_update(n)
  135. tfm.exec.addImage(p[n].hot_items[0].img, "&0", 609, 32,n);
  136. tfm.exec.addImage(p[n].hot_items[1].img, "&1", 152, 32,n);
  137. tfm.exec.addImage(p[n].hot_items[2].img, "&2", 203, 32,n);
  138. tfm.exec.addImage(p[n].hot_items[3].img, "&3", 254, 32,n);
  139. tfm.exec.addImage(p[n].hot_items[4].img, "&4", 305, 32,n);
  140. tfm.exec.addImage(p[n].hot_items[5].img, "&5", 355, 32,n);
  141. tfm.exec.addImage(p[n].hot_items[6].img, "&6", 406, 32,n);
  142. tfm.exec.addImage(p[n].hot_items[7].img, "&7", 457, 32,n);
  143. tfm.exec.addImage(p[n].hot_items[8].img, "&8", 508, 32,n);
  144. tfm.exec.addImage(p[n].hot_items[9].img, "&9", 558, 32,n);
  145. end
  146.  
  147. function eventTextAreaCallback(id,name,link)
  148. if link == "shop" then
  149. eventTextAreaCallback(nil,name,'close')
  150. ui.addTextArea(51,"",name,150,75,500,300,nil,0x324650,nil,true,true)
  151. ui.addTextArea(52,"<p align='center'><J><font size='15'><B>Loja",name,148,77,504,22,nil,0x324645,nil,true,true)
  152. ui.addTextArea(53,"<font size='13'><p align='center'><R><B><a href='event:close'>Fechar</a>",name,152,352,496,20,0x1a2b30,0x1a2b30,nil,true,true)
  153. ui.addTextArea(54,"<p align='center'><J><font size='12'><B><VP>"..p[name].coins.." R$",name,542,318,100,22,nil,0x324645,nil,true,true)
  154. grids(name)
  155. end
  156.  
  157. if link == "inv" then
  158. eventTextAreaCallback(nil,name,'close')
  159. ui.addTextArea(51,"",name,150,75,500,300,nil,0x324650,nil,true,true)
  160. ui.addTextArea(52,"<p align='center'><J><font size='15'><B>Inventário",name,148,77,504,22,nil,0x324645,nil,true,true)
  161. ui.addTextArea(53,"<font size='13'><p align='center'><R><B><a href='event:close'>Fechar</a>",name,152,352,496,20,0x1a2b30,0x1a2b30,nil,true,true)
  162. ui.addTextArea(54,"<p align='center'><a href='event:previous'><b>←</b></a></p>",name,590,318,16,16,nil,0x324650,nil,true,true)
  163. ui.addTextArea(55,"<p align='center'><a href='event:next'><b>→</b></a></p>",name,620,318,16,16,nil,0x324650,nil,true,true)
  164.  
  165. p[name].inv = true
  166. p[name].id = 1
  167. inv_grids(name)
  168. end
  169.  
  170. if link == "next" and p[name].id < #p[name].inventory then
  171. p[name].id = p[name].id+1
  172. inv_grids(name)
  173. end
  174.  
  175. if link == "previous" and p[name].id > 1 then
  176. p[name].id = p[name].id-1
  177. inv_grids(name)
  178. end
  179.  
  180. if link == "close" then
  181. p[name].inv = false
  182. for i,v in pairs({51,52,53,54,55}) do
  183. ui.removeTextArea(v,name)
  184. ui.removeTextArea(6969+v,name)
  185. ui.removeTextArea(7979+v,name)
  186. end
  187.  
  188. for i,v in pairs(ids) do
  189. ui.removeTextArea(v,name)
  190. ui.removeTextArea(6969+v,name)
  191. ui.removeTextArea(7979+v,name)
  192. end
  193.  
  194. for i,v in pairs(p[name].images_grid) do
  195. tfm.exec.removeImage(v)
  196. end
  197. end
  198.  
  199. for i,v in pairs(shop) do
  200. if link == "info-"..v.n then
  201. ui.addPopup(0,3,"<p align='center'><B><I><font color='#ffcc00'>Informações do(a) "..v.n.."</font><br><font color='#C53DFF'>Preço:</font> "..v.price.." R$<br><font color='#2ECF73'>Dano de Attack:</font> "..v.dmg,name,151,300,499,true)
  202. end
  203.  
  204. if link == "buy-"..v.n then
  205. if p[name].coins >= v.price then
  206. tfm.exec.chatMessage("<B><VP>[SHOP::"..v.n.."]</VP> <J>Item comprado com sucesso, -"..v.price.."R$.</J></B>",name)
  207. p[name].coins=p[name].coins-v.price
  208. table.insert(p[name].inventory,{n=v.n,dmg=v.dmg,img=v.img})
  209. eventTextAreaCallback(nil,name,'shop')
  210. else
  211. tfm.exec.chatMessage("<B><VP>[SHOP::"..v.n.."]</VP> Dinheiro insuficiente para a compra deste item.</B>",name)
  212. end
  213. end
  214. end
  215.  
  216. for i,v in pairs(p[name].inventory) do
  217. if link == "info-inv-"..v.n then
  218. ui.addPopup(0,3,"<p align='center'><B><I><font color='#ffcc00'>Informações do(a) "..v.n.."</font><br><font color='#2ECF73'>Dano de Attack:</font> "..v.dmg,name,151,300,499,true)
  219. end
  220. end
  221. end
  222.  
  223. function grids(name)
  224. x_ = 104
  225. c = 0
  226. y_ = 115
  227. v = 0
  228.  
  229. images_grid = {}
  230.  
  231. ids={}
  232. for i,v in pairs(shop) do
  233. x_ = x_+50
  234. c = c+1
  235. buy = true
  236.  
  237. for i,inv in pairs(p[name].inventory) do
  238. if v.img == inv.img then
  239. buy = false
  240. break
  241. end
  242. end
  243.  
  244. if buy then
  245. addGrid(c,v.img,"Buy",x_,y_,name,v.n)
  246. else
  247. addGrid(c,v.img,"",x_,y_,name,v.n,true)
  248. end
  249. end
  250. end
  251.  
  252. function inv_grids(name)
  253. for i,v in pairs(p[name].images_grid) do
  254. tfm.exec.removeImage(v)
  255. end
  256.  
  257. x_ = 104
  258. c = 0
  259. y_ = 115
  260. v = 0
  261.  
  262. p[name].images_grid = {}
  263.  
  264. ids={}
  265. for i,v in pairs(p[name].inventory) do
  266. x_ = x_+50
  267. c = c+1
  268. if p[name].id == i then
  269. p[name].itm_selected={img=v.img,dmg=v.dmg}
  270. end
  271.  
  272. addGrid(c,v.img,"",x_,y_,name,v.n,true)
  273. end
  274. end
  275.  
  276. function addGrid(id,img,buttonText,x,y,name,item,inv)
  277. id = 8989+id
  278. id2 = 4949+id
  279. id3 = 3939+id
  280.  
  281. if (id-8989) == p[name].id and inv then
  282. ui.addTextArea(id,"",name,x,y,80,78,0x0b161c,0x8B8B7A,nil,true)
  283. else
  284. ui.addTextArea(id,"",name,x,y,80,78,0x0b161c,0x0b161c,nil,true)
  285. end
  286.  
  287. if buttonText ~= "" or buttonText ~= nil then
  288. ui.addTextArea(id2,"<p align='center'><B><J><a href='event:buy-"..item.."'>"..buttonText.."</a>",name,x+1,y+61,30,16,0x38516b,0x38516b,nil,true)
  289. if inv then
  290. ui.addTextArea(id3,"<p align='center'><B><V><a href='event:info-inv-"..item.."'>Info</a>",name,x+1,y+61,78,16,0x38516b,0x38516b,nil,true)
  291. else
  292. ui.addTextArea(id3,"<p align='center'><B><V><a href='event:info-"..item.."'>Info</a>",name,x+42,y+61,37,16,0x38516b,0x38516b,nil,true)
  293. end
  294. else
  295. ui.addTextArea(id3,"<p align='center'><B><V><a href='event:info-"..item.."'>Info</a>",name,x+1,y+61,67,16,0x38516b,0x38516b,nil,true)
  296. end
  297. img = tfm.exec.addImage(img, "&0", x+20, y+8,name);
  298.  
  299. table.insert(p[name].images_grid,img)
  300. x_=x_+52
  301.  
  302. v=v+1
  303. if v == 5 then
  304. x_ = 104
  305. y_ = y_+100
  306. v=0
  307. end
  308.  
  309. table.insert(ids,id)
  310. table.insert(ids,id2)
  311. table.insert(ids,id3)
  312. end
  313.  
  314. function eventPlayerDied(name)
  315. vivos=vivos-1;
  316.  
  317. if vivos == 0 then
  318. tfm.exec.newGame(mapas[math.random(#mapas)])
  319. end
  320. end
  321.  
  322. function eventNewGame()
  323. tfm.exec.setGameTime(9999999)
  324. npcs = {}
  325.  
  326. for id=200,400 do
  327. ui.removeTextArea(id,nil)
  328. end
  329.  
  330. vivos = 0
  331.  
  332. for n, i in pairs(tfm.get.room.playerList) do
  333. p[n].life = p[n].maxLife
  334. lifeBar(n)
  335. vivos=vivos+1;
  336. end
  337.  
  338. end
  339.  
  340. function eventKeyboard(name,key,down,x,y)
  341. if key == 32 and p[name].tempo < os.time()-800 then
  342. for n,v in pairs(npcs) do
  343. if x >= tfm.get.room.objectList[v.id].x - 25 and x <= tfm.get.room.objectList[v.id].x + 25 and y >= tfm.get.room.objectList[v.id].y - 25 and y <= tfm.get.room.objectList[v.id].y + 25 and not tfm.get.room.playerList[name].isDead then
  344. itm = p[name].hot_selected[1]
  345. v.life = v.life-p[name].hot_items[itm].dmg
  346. p[name].tempo = os.time();
  347.  
  348. if v.life < 1 then
  349. p[name].delete = v.id
  350. p[name].delete2 = n
  351. p[name].coins = p[name].coins+v.coins
  352. if p[name].life < p[name].maxLife then
  353. p[name].life = p[name].life+math.random(5,v.maxLife)
  354. end
  355.  
  356. if p[name].life > p[name].maxLife then
  357. p[name].life = p[name].maxLife
  358. end
  359.  
  360. lifeBar(name)
  361. end
  362. end
  363. end
  364. end
  365.  
  366. if p[name].delete ~= '' then
  367. ui.removeTextArea(p[name].delete,nil)
  368. table.remove(npcs,p[name].delete2)
  369. tfm.exec.removeObject(p[name].delete)
  370. p[name].delete = ''
  371. end
  372.  
  373. if key_def(key) then
  374. if p[name].inv then
  375. hot_update(name)
  376. p[name].hot_items[key_number(key)]={img=p[name].itm_selected.img,dmg=p[name].itm_selected.dmg}
  377. end
  378. ui.addTextArea(p[name].hot_selected[1],"<p align='left'><font color='#000000'>"..p[name].hot_selected[1],name,p[name].hot_selected[2],30,40,32,colors.hot_unselected,colors.hot_unselected,80,true)
  379. p[name].hot_selected = {key_number(key),key_x(key_number(key)),initial_item}
  380. ui.addTextArea(p[name].hot_selected[1],"<p align='left'><font color='#ffffff'>"..p[name].hot_selected[1],name,p[name].hot_selected[2],30,40,32,colors.hot_selected,colors.hot_unselected,80,true)
  381. end
  382. end
  383.  
  384. -- Sistema de vida por Fofinhoppp
  385. -- 21/12/2016
  386. function lifeBar(player)
  387. if not p[player] then return end
  388. local mLife = p[player].maxLife
  389. local life = p[player].life
  390. ui.addTextArea(10, '', player, -13, 25, 10, 370, 0xFF0000, 0xFF0000, 1, true)
  391. ui.addTextArea(11, '', player, -13, 395-(370/mLife)*life, 10, (370/mLife)*life, 0x00FF00, 0x00FF00, 1, true)
  392. ui.addTextArea(12, '', player, -15, 0, 10, 440, 0x6a7595, 0x6a7595, 1, true)
  393. tfm.exec.setPlayerScore(player,life,false)
  394. end
  395.  
  396. function eventLoop()
  397. if time_spawn < os.time()-3000 and #npcs < 20 then
  398. local monster = tfm.exec.addShamanObject(6300,math.random(10,3000),math.random(20,360))
  399. local imagem = zombies[math.random(#zombies)]
  400. local image = tfm.exec.addImage(imagem[math.random(1,2)], "#"..monster, -imagem[4], -imagem[5])
  401. local vida = math.random(10,imagem[7])
  402.  
  403.  
  404. table.insert(npcs,{id=monster,maxLife=vida,life=vida,damage=math.random(1,imagem[8]),img=image,textareaHeight=imagem[3],name=imagem[6],type = imagem,coins=math.random(1,imagem[9])})
  405. time_spawn = os.time();
  406. end
  407.  
  408. for i,v in pairs(npcs) do
  409. for n,pi in pairs(tfm.get.room.playerList) do
  410. if pi.x >= tfm.get.room.objectList[v.id].x - 12 and pi.x <= tfm.get.room.objectList[v.id].x + 12 and pi.y >= tfm.get.room.objectList[v.id].y - 25 and pi.y <= tfm.get.room.objectList[v.id].y + 25 and not tfm.get.room.playerList[n].isDead then
  411. p[n].life = p[n].life-v.damage
  412. lifeBar(n)
  413. if p[n].life < 1 then
  414. p[n].life = 0
  415. tfm.exec.killPlayer(n)
  416. end
  417. end
  418.  
  419. if pi.x >= tfm.get.room.objectList[v.id].x - 180 and pi.x <= tfm.get.room.objectList[v.id].x + 180 and pi.y >= tfm.get.room.objectList[v.id].y - 50 and pi.y <= tfm.get.room.objectList[v.id].y + 50 and not tfm.get.room.playerList[n].isDead then
  420. if pi.x > tfm.get.room.objectList[v.id].x then
  421. tfm.exec.moveObject(v.id,0,0,false,10,0,true)
  422. tfm.exec.removeImage(v.img)
  423. tfm.exec.addImage(v.type[2], '#'..v.id, -v.type[4], -v.type[5])
  424. elseif pi.x < tfm.get.room.objectList[v.id].x then
  425. tfm.exec.moveObject(v.id,0,0,false,-10,0,true)
  426. tfm.exec.removeImage(v.img)
  427. tfm.exec.addImage(v.type[1], '#'..v.id, -v.type[4], -v.type[5])
  428. end
  429.  
  430. if pi.x < tfm.get.room.objectList[v.id].y then
  431. tfm.exec.moveObject(v.id,0,0,false,0,-15,true)
  432. end
  433.  
  434. pular = math.random(0,5)
  435.  
  436. if pular == 2 then
  437. tfm.exec.moveObject(v.id,0,0,false,0,-30,true)
  438. end
  439.  
  440. ui.addTextArea(v.id,"<V>"..v.name.."<br><VI><font color='#FF0000'>♥ </font>"..v.life.."/"..v.maxLife.."</CR>",n,tfm.get.room.objectList[v.id].x-30,tfm.get.room.objectList[v.id].y-v.textareaHeight,50,nil,nil,0,70,false)
  441. else
  442. ui.removeTextArea(v.id,n)
  443. end
  444. end
  445. end
  446. end
  447.  
  448. function key_def(key)
  449. returno = false
  450. for i,v in pairs(keys) do
  451. if key == v then
  452. retorno = true
  453. end
  454. end
  455.  
  456. if key == 32 or key == 37 or key == 39 then
  457. retorno = false
  458. end
  459.  
  460. return retorno
  461. end
  462.  
  463. function key_number(key)
  464. keys_num = {}
  465. keys_num[48] = 0
  466. keys_num[49] = 1
  467. keys_num[50] = 2
  468. keys_num[51] = 3
  469. keys_num[52] = 4
  470. keys_num[53] = 5
  471. keys_num[54] = 6
  472. keys_num[55] = 7
  473. keys_num[56] = 8
  474. keys_num[57] = 9
  475. return keys_num[key]
  476. end
  477.  
  478. function key_x(key)
  479. keys_x = {}
  480. keys_x[0] = 609
  481. keys_x[1] = 152
  482. keys_x[2] = 203
  483. keys_x[3] = 254
  484. keys_x[4] = 305
  485. keys_x[5] = 355
  486. keys_x[6] = 406
  487. keys_x[7] = 457
  488. keys_x[8] = 508
  489. keys_x[9] = 558
  490. return keys_x[key]
  491. end
  492.  
  493. for all in pairs(tfm.get.room.playerList) do
  494. eventNewPlayer(all)
  495. end
  496.  
  497. tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement