Advertisement
alditojeje

Untitled

Aug 27th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.04 KB | None | 0 0
  1. --[[
  2. Cosas por hacer ;v
  3. Contador
  4. Sistema dificultad
  5.  
  6.  
  7. Minijuegos:
  8. Repetir una secuencia de caritas
  9. Pregunta: en que año se creó transformice
  10. ¡Estás congelado! [congelar a toda la sala]
  11. ¡Ahora estas atado a X! [pareja]
  12. Alguien tiene que morir! // Aparecen objetos de chaman que intentan matarte
  13. Haz X click en la pantalla
  14. Tas chikito
  15. Transformar a alguien en vamp, alejarlo de los demas, cuando alguien más se transforme, se muera
  16. Elije tu número de la suerte
  17. ¡Haz click para generar una explosión! [just one for person, not too explosive]
  18. Pon la bandera de X[chile, arg] pais!
  19. Abraza a alguien U//w//U r
  20. Copia la siguiente frase: "mi mama me mima", etc,etc
  21. Cuanto es 10x10?
  22. El ultimo en hacer click muere
  23. Escoje un bando. Palta o aguacate? [dos textareas, el mas bajo, mueren TODOS]
  24. Escribe !hate [nombreDeJugador] para matar al jugador mas odiado
  25. Cuál es el número de tu titulo? [pa hard i guess] wtf imposible SI ES POSIBLE
  26. Escribe el nombre de tu tribu ["Ninguno"] si no tienes
  27. ¿En que fecha te registraste?
  28. ¿Estás muerto? o.O
  29. Cuántos puntos tienes?
  30. Quedate CAMINANDO hacia la derecha
  31. Lluvia de cañones!
  32. Está lloviendo lava!
  33. Presiona X veces X tecla!
  34. Ten cuidado! Tienes super velocidad carnal! // tu rata se ha vuelto loka
  35. Saltar es mas pesado // tfm.exec.movePlayer(name, 0, 0, true, 0, 100, true)
  36.  
  37.  
  38. PONER QUE SE DESACTIVE MEEP AL INICIAR NUEVO MAPA, player.info[nombre].alive = true TAMBIÉN
  39.  
  40. ]]
  41. local counter = 0
  42. local seconds = 20
  43. local rounds = 0
  44. local difficulty = 0
  45. local message = ""
  46. local player = {info = {}}
  47. local playersAlive = {}
  48. local killPlayers = {}
  49. local counterMinigames = 0
  50. --local timeNewRound = os.time() + 2000 -- Empieza con 15s extras
  51. local timeNewRound = os.time()
  52. local frases = {}
  53.  
  54. tfm.exec.disableAutoNewGame()
  55. tfm.exec.disableAutoShaman()
  56. tfm.exec.disableAutoTimeLeft()
  57. tfm.exec.disablePhysicalConsumables()
  58. tfm.exec.disableAutoScore()
  59.  
  60. ui.addTextArea(0, "<R><font size='20'><p align='center'>" .. seconds .. "</R>", nil, 378, 32, 30, 30, 0x2B2B2B, 0x121212, 0.7, true) -- Tiempo
  61.  
  62. addGender = function(nombre)
  63. if tfm.get.room.playerList[nombre].gender == 2 then
  64. player.info[nombre].genero = "masculino"
  65. elseif tfm.get.room.playerList[nombre].gender == 1 then
  66. player.info[nombre].genero = "femenino"
  67. else
  68. player.info[nombre].genero = "ninguno"
  69. end
  70. end
  71.  
  72. stats = function()
  73. for _, nombre in pairs(playersAlive) do
  74. player.info[nombre].roundWin = false
  75. player.info[nombre].clicks = 0
  76. player.info[nombre].countE = 0
  77. player.info[nombre].team = ""
  78. player.info[nombre].clicksTextareas = 0
  79. addGender(nombre)
  80. counterMinigames = 0
  81. end
  82. end
  83.  
  84. teclasPlayer = function (nombre)
  85. tfm.exec.bindKeyboard(nombre, 37, true, true) -- Arrow Left
  86. tfm.exec.bindKeyboard(nombre, 38, true, true) -- Arrow UP
  87. tfm.exec.bindKeyboard(nombre, 39, true, true) -- Arrow Right
  88. tfm.exec.bindKeyboard(nombre, 40, true, true) -- Arrow Down
  89. tfm.exec.bindKeyboard(nombre, 83, true, true) -- S
  90. tfm.exec.bindKeyboard(nombre, 87, true, true) -- W
  91. tfm.exec.bindKeyboard(nombre, 90, true, true) -- Z
  92. tfm.exec.bindKeyboard(nombre, 65, true, true) -- A
  93. tfm.exec.bindKeyboard(nombre, 68, true, true) -- D
  94. tfm.exec.bindKeyboard(nombre, 81, true, true) -- Q
  95. tfm.exec.bindKeyboard(nombre, 69, true, true) -- E
  96. end
  97.  
  98. eventNewPlayer = function (nombre)
  99. table.insert(playersAlive, nombre)
  100. player.info[nombre] = {}
  101. player.info[nombre].alive = true
  102. -- player.info[nombre].roundWin = false -- ESTOS SE AGREGAN EN STATS()
  103. -- player.info[nombre].clicks = 0 -- ESTOS SE AGREGAN EN STATS()
  104. system.bindMouse(nombre, true)
  105. teclasPlayer(nombre)
  106. -- addGender(nombre) -- ESTOS SE AGREGAN EN STATS()
  107. end
  108.  
  109. for i, k in pairs(tfm.get.room.playerList) do
  110. eventNewPlayer(i)
  111. end
  112.  
  113. eventMouse = function (nombre, posX, posY)
  114. if player.info[nombre].alive then
  115. if minigame == 3 then
  116. player.info[nombre].clicks = player.info[nombre].clicks + 1
  117. if player.info[nombre].clicks >= 10 then
  118. player.info[nombre].roundWin = true
  119. end
  120. end
  121. end
  122. end
  123.  
  124. infoGame = function (message)
  125. ui.addTextArea(1, "<BV><font size='20'><p align='center'><b>" .. message .."</BV></b>", nil, 150, 360, 500, 30, 0x2B2B2B, 0x121212, 0.7, true)
  126. end
  127.  
  128. eventChatMessage = function (nombre, mensaje)
  129. if player.info[nombre].alive then
  130. if minigame == 1 then
  131. if mensaje:lower() == player.info[nombre].genero then
  132. player.info[nombre].roundWin = true
  133. end
  134. elseif minigame == 11 then
  135. tfm.exec.killPlayer(nombre)
  136. elseif (minigame == 15) and mensaje == tostring(numeroMinigame) then
  137. player.info[nombre].roundWin = true
  138. elseif minigame == 18 and mensaje == "2010" then
  139. player.info[nombre].roundWin = true
  140. end
  141. end -- end playerAlive
  142. end
  143.  
  144. saberDificultad = function ()
  145. if difficulty == 0 then
  146. return "<PT>Fácil</PT>"
  147. elseif difficulty == 1 then
  148. return "<A:ACTIVE>Medio</A:ACTIVE>"
  149. elseif difficulty == 2 then
  150. return "<R>Difícil</R>"
  151. elseif difficulty == 3 then
  152. return "<font color='#F93018'>Experto</font>"
  153. end
  154. end
  155.  
  156. clickTextareas = function ()
  157. for i = 100, cantidad + 100 do
  158. ui.addTextArea(i, "<BV><font size='34'><p align='center'><a href='event:clicksTextarea'>•</BV>", nil, math.random(10, 790), math.random(50, 300), 0, 0, 0, 0, 0, true)
  159. end
  160. end
  161.  
  162. newRound = function()
  163. rounds = rounds + 1
  164. if rounds == 5 or rounds == 10 or rounds == 20 or rounds == 30 then -- En las rondas 5, 10, 20 y 30 aumenta la difcultad
  165. difficulty = difficulty + 1
  166. end
  167. ui.setMapName ("<N>Dificultad: </N>" .. saberDificultad() .. " <G>|</G> <N>Ronda: </N><BV>" .. rounds)
  168. stats()
  169. for i = 100, 130 do -- remove all
  170. ui.removeTextArea(i, nil)
  171. end
  172. ui.removeTextArea(7, nil) -- remove ganador palta/aguacate
  173. if difficulty == 0 then -- EASY
  174. minigame = math.random(16)
  175. minigame = 16
  176. seconds = 10
  177. if minigame == 1 then
  178. message = "¡Escribe el género de tu perfil!"
  179. elseif minigame == 2 then
  180. message = "¡Esquiva la lava!"
  181. allWin()
  182. elseif minigame == 3 then
  183. seconds = seconds - 2
  184. message = "¡Haz click en la pantalla 10 veces!"
  185. elseif minigame == 4 then
  186. seconds = seconds - 4
  187. message = "¡Quedate MIRANDO hacia la derecha!"
  188. elseif minigame == 5 then
  189. seconds = seconds - 4
  190. message = "¡Quedate MIRANDO hacia la izquierda!"
  191. elseif minigame == 6 then
  192. message= "¡Agachate para cavar tu tumba!"
  193. allWin()
  194. elseif minigame == 7 then
  195. message = "¡No saltes!"
  196. allWin()
  197. elseif minigame == 8 then
  198. message = "¡No te muevas!"
  199. allWin()
  200. elseif minigame == 9 then
  201. message = "Lanza confeti 5 veces"
  202. elseif minigame == 10 then
  203. seconds = 6
  204. message = "¡Baila!"
  205. elseif minigame == 11 then
  206. message = "Si mandas un mensaje, ¡mueres!"
  207. allWin()
  208. elseif minigame == 12 then
  209. seconds = 6
  210. message = "¡Todos tienen meep!"
  211. allWin()
  212. meep(true)
  213. elseif minigame == 13 then
  214. message = "¡No te muevas hacia la derecha!"
  215. allWin()
  216. elseif minigame == 14 then
  217. message = "¡No te muevas hacia la izquierda!"
  218. allWin()
  219. elseif minigame == 15 then
  220. numeroMinigame = math.random(1000000, 10000000)
  221. message = "Escribe este numero: <R>" .. numeroMinigame .. "</R>"
  222. elseif minigame == 16 then
  223. message = "¿Palta o aguacate? ¡Morirá el peor equipo!"
  224. ui.addTextArea(5, "<A:ACTIVE><font size='16'><p align='center'><a href='event:palta'><b>Palta</a></PT>", nil, 140, 160, 0, 30, 0x2B2B2B, 0x121212, 0.7, true)
  225. ui.addTextArea(6, "<A:ACTIVE><font size='16'><p align='center'><a href='event:aguacate'><b>Aguacate</a></PT>", nil, 600, 160, 0, 30, 0x2B2B2B, 0x121212, 0.7, true)
  226. elseif minigame == 17 then
  227. message = "¡Haz click en todos los puntos!"
  228. seconds = 21
  229. cantidad = 10
  230. clickTextareas(cantidad)
  231. elseif minigame == 18 then
  232. message = "¿En qué año se publicó Transformice?"
  233. elseif minigame == 19 then
  234. message = "¡Pon la bandera de Argentina!"
  235. elseif minigame == 20 then
  236. allWin()
  237. seconds = 26
  238. poscX, poscY, rotacion = math.random(10,790), math.random(20, 200), math.random(90, 120)
  239. if poscX >= 400 then
  240. rotacion = rotacion * -1
  241. end
  242. message = "¡Esquiva los cañones!"
  243. end
  244. elseif difficulty == 1 then -- MEDIUM
  245.  
  246. elseif difficulty == 2 then -- HARD
  247.  
  248. elseif difficulty == 3 then -- EXPERT
  249.  
  250. end
  251. infoGame(message)
  252. end
  253.  
  254. eventTextAreaCallback = function (id, nombre, callback)
  255. if player.info[nombre].alive then
  256. if minigame == 16 then
  257. if callback == "palta" then
  258. player.info[nombre].team = "palta"
  259. tfm.exec.chatMessage("¡Ahora estás en el equipo Palta!", nil)
  260. else
  261. player.info[nombre].team = "aguacate"
  262. tfm.exec.chatMessage("¡Ahora estás en el equipo Aguacate!", nil)
  263. end
  264. elseif minigame == 17 then
  265. if callback == 'clicksTextarea' then
  266. ui.removeTextArea(id, nombre)
  267. player.info[nombre].clicksTextareas = player.info[nombre].clicksTextareas + 1
  268. if player.info[nombre].clicksTextareas >= cantidad then
  269. player.info[nombre].roundWin = true
  270. end
  271. end
  272. end
  273. end -- end playerAlive
  274. end
  275.  
  276. meep = function(activo)
  277. for _, nombre in pairs(playersAlive) do
  278. tfm.exec.giveMeep(nombre, activo)
  279. end
  280. end
  281.  
  282. removeItem = function (myTable, key)
  283. for i, keyTable in ipairs(myTable) do
  284. if keyTable == key then
  285. table.remove(myTable, i)
  286. return
  287. end
  288. end
  289. end
  290.  
  291. rondaTerminada = function ()
  292. if minigame == 4 then
  293. for _, nombre in pairs(playersAlive) do
  294. if tfm.get.room.playerList[nombre].isFacingRight then
  295. player.info[nombre].roundWin = true
  296. end
  297. end
  298. elseif minigame == 5 then
  299. for _, nombre in pairs(playersAlive) do
  300. if not tfm.get.room.playerList[nombre].isFacingRight then
  301. player.info[nombre].roundWin = true
  302. end
  303. end
  304. elseif minigame == 16 then
  305. contPalta = 0
  306. contAguacate = 0
  307. ui.removeTextArea(5, nil)
  308. ui.removeTextArea(6, nil)
  309. for _, nombre in pairs(playersAlive) do
  310. if player.info[nombre].team == "palta" then
  311. contPalta = contPalta + 1
  312. elseif player.info[nombre].team == "aguacate" then
  313. contAguacate = contAguacate + 1
  314. end
  315. end
  316. if contPalta > contAguacate then
  317. ganadorFruta = "Palta"
  318. elseif contPalta < contAguacate then
  319. ganadorFruta = "Aguacate"
  320. else
  321. ganadorFruta = "¡Empate!"
  322. end
  323. ui.addTextArea(7, "<BV><font size='16'><p align='center'><b>El ganador es: <R>" .. ganadorFruta .. "</R></BV>", nil, 280, 160, 0, 30, 0x2B2B2B, 0x121212, 0.7, true)
  324. for _, nombre in pairs(playersAlive) do
  325. if (player.info[nombre].team == ganadorFruta:lower()) or ganadorFruta == "¡Empate!" then
  326. player.info[nombre].roundWin = true
  327. end
  328. end
  329.  
  330.  
  331. end
  332. minigame = 999
  333.  
  334. for _, nombre in pairs(playersAlive) do -- agregar al array kilLPlayers todos los jugadores que no hayan termiando la ronda.
  335. if not player.info[nombre].roundWin then
  336. table.insert(killPlayers, nombre)
  337. end
  338. end
  339. for _, nombre in pairs(killPlayers) do -- los mata, y los elimina de playersAlive
  340. tfm.exec.killPlayer(nombre)
  341. removeItem(playersAlive, nombre)
  342. end
  343. killPlayers = {}
  344. ui.removeTextArea(1, nil)
  345. timeNewRound = os.time()
  346. end
  347.  
  348. eventEmotePlayed = function(nombre, idEmote, bandera)
  349. if player.info[nombre].alive then
  350. if minigame == 10 and idEmote == 0 then
  351. player.info[nombre].roundWin = true
  352. elseif minigame == 19 and idEmote == 10 and bandera == "ar" then
  353. player.info[nombre].roundWin = true
  354. end
  355. end
  356. end
  357.  
  358. eventPlayerDied = function(nombre)
  359. removeItem(playersAlive, nombre)
  360. player.info[nombre].alive = false
  361. end
  362.  
  363. allWin = function()
  364. for i, k in pairs(playersAlive) do
  365. player.info[k].roundWin = true
  366. end
  367. end
  368.  
  369. tfm.exec.newGame('7773692')
  370. tfm.exec.setGameTime(100000)
  371.  
  372. eventLoop = function (elapsed, remaining)
  373. counter = counter + 1 -- cada 0.5s el contador aumenta en 1
  374. if counter >= 2 and seconds > 0 then -- si pasó 1s entonces..
  375. seconds = seconds - 1 -- se resta 1s
  376. ui.updateTextArea(0, "<R><font size='20'><p align='center'>" .. seconds .. "</R>", nil) -- se actualiza el textarea
  377. counter = 0
  378.  
  379. if minigame == 2 then
  380. counterMinigames = counterMinigames + 1
  381. if counterMinigames >= 2 then
  382. rainLava(800, 0, 30, 30)
  383. counterMinigames = 0
  384. end
  385. elseif minigame == 20 then
  386. counterMinigames = counterMinigames + 1
  387. if counterMinigames == 1 then
  388. tfm.exec.addShamanObject(0, poscX-7, poscY-7, rotacion + 180)
  389. elseif counterMinigames >= 2 then
  390. spawnearCn()
  391. end
  392. end
  393. if seconds == 0 then
  394. rondaTerminada()
  395. end
  396. end
  397.  
  398. if timeNewRound < os.time() - 5000 then
  399. timeNewRound = 9999999999999
  400. newRound()
  401. end
  402. end
  403.  
  404. spawnearCn = function ()
  405. tfm.exec.addShamanObject(math.random(1701,1714), poscX, poscY, rotacion, 10, 10)
  406. counterMinigames = 0
  407. poscX, poscY, rotacion = math.random(10,790), math.random(20, 200), math.random(90, 120)
  408. if poscX >= 400 then
  409. rotacion = rotacion * -1
  410. end
  411. end
  412.  
  413. rainLava = function(mapLength, id, lavaWidht, lavaHeigth)
  414. tfm.exec.addPhysicObject(id, math.random(mapLength), 0, {
  415. type = 3,
  416. width = lavaWidht,
  417. height = lavaHeigth,
  418. friction = 0.2,
  419. restitution = 9999,
  420. miceCollision = true,
  421. groundCollision = false,
  422. dynamic = true,
  423. fixedRotation = true,
  424. mass = 10,
  425. linearDamping = 0
  426. })
  427. end
  428.  
  429. eventKeyboard = function(nombre, key, down, posX, posY)
  430. if player.info[nombre].alive then
  431. if (minigame == 6) and (key == 40 or key == 83) and (not tfm.get.room.playerList[nombre].isDead) then -- Se coloca entre () la primera condición para que si alguna de las dos es true pase a la siguiente.
  432. tfm.exec.killPlayer(nombre)
  433. tfm.exec.addShamanObject(90, posX, posY)
  434. elseif (minigame == 7) and (key == 38 or key == 87 or key == 90) then
  435. tfm.exec.killPlayer(nombre)
  436. elseif (minigame == 8) and (key == 38 or key == 39 or key == 37 or key == 87 or key == 90 or key == 40 or key == 83 or key == 65 or key == 68 or key == 81) then
  437. tfm.exec.killPlayer(nombre)
  438. elseif minigame == 9 and key == 69 then
  439. player.info[nombre].countE = player.info[nombre].countE + 1
  440. if player.info[nombre].countE >= 5 then
  441. player.info[nombre].roundWin = true
  442. end
  443. elseif (minigame == 13) and (key == 39 or key == 68) then
  444. tfm.exec.killPlayer(nombre)
  445. elseif (minigame == 14) and (key == 37 or key == 81) then
  446. tfm.exec.killPlayer(nombre)
  447. end
  448. end -- END Playeralive
  449. end
  450.  
  451.  
  452. -- MAYBE AGREGAR, BOMBAS CON ESPACIO:
  453. --[[
  454. local toDespawn = {}
  455. local mice = {}
  456. local countdownBomb = 2000 -- Segundos para poder colocar otra bomba
  457. local countDownExplode = 1000 -- Segundos para que explote la bomba.
  458. local power = 100 -- Fuerza con la que empujará a las ratas.
  459. local area = 60 -- Área de empuje
  460. local miceOnly = false -- Cambiar a "true" (sin las comillas) en caso de que quieras que los objetos en la sala no se muevan
  461.  
  462. function main()
  463. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  464. end
  465.  
  466. function eventNewPlayer(name)
  467. if not mice[name] then
  468. mice[name] = {
  469. timeStamp = os.time()
  470. }
  471. end
  472. tfm.exec.bindKeyboard(name, 32, true, true)
  473. end
  474.  
  475. function eventLoop(time, remaining)
  476. for i, bomb in ipairs(toDespawn) do
  477. if bomb[1] <= os.time() - countDownExplode then
  478. local x = tfm.get.room.objectList[bomb[2]]--.x
  479. -- local y = tfm.get.room.objectList[bomb[2]]--.y
  480. --[[
  481. tfm.exec.removeObject(bomb[2])
  482. table.remove(toDespawn, i)
  483. tfm.exec.explosion(x, y, power, area, miceOnly)
  484. end
  485. end
  486. end
  487.  
  488. function eventKeyboard(name, key, down, x, y)
  489. if mice[name].timeStamp < os.time() - countdownBomb then
  490. local bomb = tfm.exec.addShamanObject(23, x, y)
  491. mice[name].timeStamp = os.time()
  492. table.insert(toDespawn, {os.time(), bomb})
  493. end
  494. end
  495.  
  496. main()
  497.  
  498. ]]
  499.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement