Advertisement
Guest User

Control

a guest
Jul 9th, 2018
795
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. --local local local
  2. tfm.exec.disableAutoShaman()
  3. tfm.exec.disableAutoShaman(true)
  4. click=os.time();
  5.  
  6. adm="Rianmojang1"
  7.  
  8. initial_id=2
  9.  
  10. tfm.exec.disableAutoScore()
  11.  
  12. --[[
  13. events:
  14. event:xis = X
  15. event:bolinha = O
  16. event:triangulo = Δ
  17. event:quadrado = ₾
  18. ]]--
  19.  
  20. ui.addTextArea(1, "", adm, 402, 267, 393, 121, 0x666666, 0x000000, 1, true)
  21. ui.addTextArea(2, "<font size=\"15\"><p align='center'><a href='event:cima'><B>↑</B></a></p>", adm, 450, 276, 24, 27, 0x000001, 0x000000, 1, true)
  22. ui.addTextArea(3, "<font size=\"15\"><p align='center'><a href='event:esquerda'><B>←</B></a></p>", adm, 415, 316, 24, 27, 0x000001, 0x000000, 1, true)
  23. ui.addTextArea(4, "<font size=\"15\"><p align='center'><a href='event:baixo'><B>↓</B></a></p>", adm, 450, 355, 24, 27, 0x000001, 0x000000, 1, true)
  24. ui.addTextArea(5, "<font size=\"15\"><p align='center'><a href='event:direita'><B>→</B></a></p>", adm, 488, 316, 24, 27, 0x000001, 0x000000, 1, true)
  25. ui.addTextArea(6, "<R><font size=\"18\"><p align='center'><a href='event:bolinha'><B>O</B></a></p>", adm, 756, 316, 24, 24, 0x000001, 0x000000, 1, true)
  26. ui.addTextArea(7, "<VP><font size=\"18\"><p align='center'><a href='event:triangulo'><B>Δ</B></a></p>", adm, 720, 276, 24, 24, 0x000001, 0x000000, 1, true)
  27. ui.addTextArea(8, "<BL><font size=\"17\"><p align='center'><a href='event:xis'><B>X</B></a></p>", adm, 720, 356, 24, 24, 0x000001, 0x000000, 1, true)
  28. ui.addTextArea(9, "<ROSE><font size=\"18\"><p align='center'><a href='event:quadrado'><B>₾</B></a></p>", adm, 685, 316, 24, 24, 0x000001, 0x000000, 1, true)
  29. ui.addTextArea(10, "<font size=\"10\"><p align='center'><a href='event:start'><B>start</B></a></p>", adm, 536, 334, 52, 20, 0x000001, 0x000000, 1, true)
  30. ui.addTextArea(11, "<font size=\"10\"><p align='center'><a href='event:select'><B>select</B></a></p>", adm, 610, 334, 52, 20, 0x000001, 0x000000, 1, true)
  31.  
  32. function eventNewGame()
  33. obj=tfm.exec.addShamanObject(initial_id,200,300)
  34.  
  35. object={
  36. id=initial_id,
  37. x=tfm.get.room.objectList[obj].x,
  38. y=tfm.get.room.objectList[obj].y,
  39. }
  40.  
  41. for i,v in pairs(tfm.get.room.playerList) do
  42. score=v.score
  43. end
  44.  
  45. tfm.exec.setPlayerScore(adm,score*2,false)
  46. end
  47.  
  48. function updateObject()
  49. tfm.exec.removeObject(obj)
  50. obj=tfm.exec.addShamanObject(object.id,object.x,object.y)
  51. object.x=tfm.get.room.objectList[obj].x
  52. object.y=tfm.get.room.objectList[obj].y
  53. click=os.time();
  54. end
  55.  
  56. function eventTextAreaCallback(id, name, link)
  57. if click < os.time()-500 then
  58. if link == "quadrado" then
  59. object.id=6
  60. updateObject()
  61. end
  62.  
  63. if link == "triangulo" then
  64. object.id=7
  65. updateObject()
  66. end
  67.  
  68. if link == "bolinha" then
  69. object.id=2
  70. updateObject()
  71. end
  72.  
  73. if link == "cima" then
  74. object.y = object.y - 10
  75. updateObject()
  76. end
  77.  
  78. if link == "baixo" then
  79. object.y = object.y + 10
  80. updateObject()
  81. end
  82.  
  83. if link == "esquerda" then
  84. object.x = object.x - 10
  85. updateObject(id)
  86. end
  87.  
  88. if link == "direita" then
  89. object.x = object.x + 10
  90. updateObject(id)
  91. end
  92. end
  93. end
  94.  
  95. tfm.exec.newGame('@7122065')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement