Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.93 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoScore(true)
  3. tfm.exec.disableAutoTimeLeft(true)
  4. tfm.exec.disableAfkDeath(true)
  5. tfm.exec.disableAllShamanSkills(true)
  6. tfm.exec.disablePhysicalConsumables(true)
  7. tfm.exec.setRoomMaxPlayers(50)
  8. t=false;
  9. f=false;
  10. tempa=20
  11. ratos=0
  12. loop=0
  13. temp2=7
  14. resposta="0"
  15. players={}
  16. votos=0
  17. vivo=0;
  18. min1=0
  19. seg1=0
  20. seg2=0
  21. segundos=0
  22. lock=false;
  23. pergunta=""
  24. shaman=""
  25. lock=false
  26. minutos=12;
  27. modo="desativado"
  28. system.disableChatCommandDisplay("admin77")
  29. system.disableChatCommandDisplay("admin78")
  30. system.disableChatCommandDisplay("kill")
  31. system.disableChatCommandDisplay("msg")
  32. system.disableChatCommandDisplay("v5")
  33. system.disableChatCommandDisplay("f5")
  34. mapa="@7002987"
  35. lang = {}
  36.  
  37. lang.br = {
  38. textFalse = "A resposta era FALSO!",
  39. textTrue = "A resposta era VERDADEIRO!",
  40. textRandom = "Um shaman aleatório foi escolhido.",
  41. textSkip = "O shaman passou a vez.",
  42. textPergunta = "Insira a sua pergunta:",
  43. textTime = "Tempo esgotado!",
  44. textShaman = "Não é permitido o uso de objetos de shaman.",
  45. textNothingWins = "Ninguém venceu esta partida. :(",
  46. textWinner = " venceu a partida!",
  47. textNothing = "Não tivemos vencedor nessa partida.",
  48. textTimeOut = "O tempo da partida acabou! Outro shaman será escolhido.",
  49. textTimeLeave = "Tempo esgotado! Outro shaman será escolhido.",
  50. textTrueFalse = "Envie 1 se a resposta for verdadeira ou 2 se a resposta for falsa.",
  51. textEnter = "<b>Bem-vindo ao module True or False! Criado por Haxhhhhhhhhh.</b><br><BL>Para maiores informações sobre o jogo, digite !help.<br><br><VP>Atualização RTM 1.61:<br>- Remoção do comando !s<br>- Pequenas alterações no script<br>- Adição de mods temporários: Priscilamel e Skyymellu",
  52. textHelp = "<J>Quando o shaman fizer uma pergunta, você deverá ir no campo TRUE se a resposta for verdadeira ou no campo FALSE se a resposta for falsa. Aqueles que errarem serão eliminados da partida. O processo continua até que sobre um vencedor, que será o novo shaman.<br>As partidas têm um tempo máximo de acordo com o número de ratos na sala.<br>Se você for o shaman, digite !per para fazer uma pergunta.<br><br>PERGUNTAS QUE NÃO DEVEM SER FEITAS:<br>- Perguntas envolvendo questões pessoais (seu nome, idade, sexo, etc)<br>- Perguntas que envolvam opinião<br>- Perguntas que envolvam racismo, sexo, pornografia e afins<br>- Pegadinhas, mesmo que não sejam intencionais<br>- Perguntas que possam causar tumulto na sala (ex: biscoito ou bolacha)<br>entre outros...<br><br>- Sugestões e Problemas reporte para Haxhhhhhhhhh.",
  53. textGotShaman = "<J>Você é o shaman. Digite <b>!per</b> para fazer uma pergunta.<br>Você tem 1 minuto para fazer sua pergunta, ou outro shaman entrará em seu lugar.<br><br>Digite <b>!skip</b> para pular sua vez de shaman.",
  54. textLowTime = "O tempo da partida está acabando.",
  55. mices = "São necessários pelo menos 4 jogadores para jogar True or False",
  56. textArea1 = "Tempo da partida:",
  57. textArea2 = "Ratos vivos:",
  58. textArea3 = "Travamento de tempo:",
  59. textLongQuestion = "Sua pergunta é muito longa. Tente usar uma pergunta menor.",
  60. textShortQuestion = "Sua pergunta é muito curta ou não é permitida.",
  61. textCmd = "<VP>Comandos do jogo:<br><br>!per = faz uma pergunta (quando você é shaman)<br>!skip = pula a sua vez (quando você é shaman)"
  62. }
  63. lang.en = {
  64. textFalse = "The answer was FALSE!",
  65. textTrue = "The answer was TRUE!",
  66. textRandom = "A random shaman has been choosed.",
  67. textSkip = "The shaman skipped your turn.",
  68. textPergunta = "Type your question here:",
  69. textTime = "Time is up!",
  70. textShaman = "Don't are allowed shaman objects.",
  71. textNothingWins = "Nothing wins the game. :(",
  72. textWinner = " wons the game!",
  73. textNothing = "Aren't winners on this game.",
  74. textTimeOut = "The game time is gone! Other shaman has been choosed.",
  75. textTimeLeave = "Time is up! Other shaman has been choosed.",
  76. textTrueFalse = "Send 1 if the answer is TRUE or send 2 if the answer is FALSE.",
  77. textEnter = "<b>Welcome to module True or False! Created by Haxhhhhhhhhh.</b><br><V>For more information of the game, type !help.<br><br><VP>Update RTM 1.61:<br>- Removal of !s command<br>- Small changes on script",
  78. textHelp = "<J>When the shaman make the question, You must go to the TRUE side if the answer is true or go to the FALSE side if the answer is false. If you err the answer, you will be eliminated of the game. The process continue until someone win the game, which will be the new shaman.<br>The rounds have a time according to mices on the room.<br>If you are the shaman, type !per to make a question.<br>QUESTIONS DON'T ALLOWED ON GAME:<br>- Questions involving pessoal things (name, age, gender...)<br>- Questions involving opinions<br>- Questions involving racism, pornography, sexual things...<br>- 'Troll' questions, included questions that aren't intencional<br>- Questions that cause turmoil on room<br>and many more...<br><br>Suggestions and problems report to Haxhhhhhhhhh.",
  79. textGotShaman = "<J>You are the shaman. Type <b>!per</b> to make a question.<br>You have 1 minute to make the question, or other shaman will enter in your place.<br><br>Type <b>!skip</b> to skip your shaman turn.",
  80. textLowTime = "The match time is ending.",
  81. mices = "Are needed at least 4 players to play True or False.",
  82. textArea1 = "Match time:",
  83. textArea2 = "Mices alive:",
  84. textArea3 = "Time lock (temporary):",
  85. textLongQuestion = "Your question is very long. Try to use a short question.",
  86. textShortQuestion = "Your question is very short or isn't allowed.",
  87. textCmd = "<VP>Game commands:<br><br>!per = make a question (only for shaman)<br>!skip = skip your shaman turn (only for shaman)"
  88. }
  89. if tfm.get.room.community == "br" then
  90. text = lang.br
  91. else
  92. text = lang.en
  93. end
  94. function obterJogadores()
  95. players={}
  96. for name,player in pairs(tfm.get.room.playerList) do
  97. if not tfm.get.room.playerList[name].isDead then
  98. table.insert(players,name)
  99. end
  100. end
  101. end
  102. function eventNewPlayer(name)
  103. ratos=ratos+1;
  104. tfm.exec.chatMessage("<J>"..text.textEnter.."",name)
  105. obterJogadores()
  106. end
  107. for name,player in pairs(tfm.get.room.playerList) do
  108. tfm.exec.setPlayerScore(name,0,false)
  109. eventNewPlayer(name)
  110. end
  111. function eventPlayerLeft(name)
  112. ratos=ratos-1;
  113. obterJogadores()
  114. end
  115. function eventChatCommand(name,message)
  116. if tfm.get.room.currentMap == "@7002987" then
  117. if message == "skip" then
  118. if tfm.get.room.playerList[name].isShaman then
  119. obterJogadores()
  120. tfm.exec.chatMessage("<R>"..text.textSkip.."",nil)
  121. eventChatCommand("Haxhhhhhhhhh","admin77")
  122. end
  123. end
  124. if message == "f5" then
  125. if name == "Haxhhhhhhhhh" then
  126. t=true;
  127. tfm.exec.chatMessage("<R>"..text.textFalse.."",nil)
  128. modo="desativado"
  129. end
  130. end
  131. if message == "v5" then
  132. if name == "Haxhhhhhhhhh" then
  133. f=true;
  134. tfm.exec.chatMessage("<VP>"..text.textTrue.."",nil)
  135. modo="desativado"
  136. end
  137. end
  138. if message == "lock" then
  139. if modo == "desativado" then
  140. if name == "Haxhhhhhhhhh" or name == "D571" then
  141. if lock == true then
  142. tfm.exec.chatMessage("Time lock disabled",nil)
  143. lock=false;
  144. else
  145. lock=true;
  146. tfm.exec.chatMessage("Time lock enabled",nil)
  147. end
  148. end
  149. end end
  150. if message == "per" then
  151. if tfm.get.room.playerList[name].isShaman then
  152. if modo == "desativado" then
  153. ui.removeTextArea(27,nil)
  154. ui.addPopup(1,2,""..text.textPergunta.."",name,250,125,350,true)
  155. end
  156. end
  157. end end
  158. if message == "return" then
  159. if modo == "pergunta" then
  160. if name == "Haxhhhhhhhhh" or name == "D571" or name == "Priscilamel" or name == "Skyymellu" then
  161. tempa=20
  162. temp2=7
  163. modo="desativado"
  164. tfm.exec.setGameTime(60)
  165. ui.removeTextArea(27,nil)
  166. pergunta=""
  167. resposta="0"
  168. tfm.exec.chatMessage("<R>The question has been cancelled by "..name.."",nil)
  169. for name,player in pairs(tfm.get.room.playerList) do
  170. tfm.exec.movePlayer(name,400,102,false,1,1,false)
  171. end
  172. end end
  173. end
  174. if(message:sub(1,7) == "admin77") then
  175. if modo == "desativado" then
  176. if name == "Haxhhhhhhhhh" or name == "D571" or name == "Priscilamel" or name == "Skyymellu" then
  177. tfm.exec.newGame(mapa)
  178. tfm.exec.setShaman(message:sub(9))
  179. end end
  180. end
  181. if(message:sub(1,7) == "admin78") then
  182. if modo == "desativado" then
  183. if name == "Haxhhhhhhhhh" or name == "D571" then
  184. tfm.exec.disableAutoShaman(true)
  185. tfm.exec.newGame(mapa)
  186. tfm.exec.setShaman(message:sub(9))
  187. tfm.exec.disableAutoShaman(false)
  188. end end
  189. end
  190. if(message:sub(0,6) == "limite") then
  191. if name == "Haxhhhhhhhhh" or name == "D571" then
  192. minutos=tonumber(message:sub(8)*60)
  193. tfm.exec.chatMessage("Time limit: "..minutos.." minutes.",nil)
  194. end
  195. end
  196. if(message:sub(0,4) == "kill") then
  197. if name == "Haxhhhhhhhhh" or name == "D571" then
  198. tfm.exec.killPlayer(message:sub(6))
  199. end
  200. end
  201. if(message:sub(0,6) == "rlimit") then
  202. if name == "Haxhhhhhhhhh" or name == "D571" then
  203. tfm.exec.setRoomMaxPlayers(message:sub(8))
  204. tfm.exec.chatMessage("Mice limit: "..message:sub(8).."",nil)
  205. end
  206. end
  207. if(message:sub(1,3) == "msg") then
  208. if name == "Haxhhhhhhhhh" then
  209. tfm.exec.chatMessage("<font color='#dedf01'><b>• [Kazarina]</b> "..message:sub(5).."",nil) end
  210. if name == "D571" then
  211. tfm.exec.chatMessage("<font color='#beca32'><b>• [Cassiopeia]</b> "..message:sub(5).."",nil) end
  212. if name == "Caitlyndma7" then
  213. tfm.exec.chatMessage("<font color='#d39c0d'><b>• [Caitlyn]</b> "..message:sub(5).."",nil) end end
  214. if message == "help" then
  215. tfm.exec.chatMessage("<N>"..text.textHelp.."",name)
  216. end
  217. if message == "cmd" then
  218. tfm.exec.chatMessage("<N>"..text.textCmd.."",name)
  219. end
  220. end
  221. function eventSummoningEnd(name,type,x,y,angle,vx,vy,obj)
  222. for name,player in pairs(tfm.get.room.playerList) do
  223. if tfm.get.room.currentMap == "@7002987" then
  224. if tfm.get.room.playerList[name].isShaman then
  225. obterJogadores()
  226. tfm.exec.chatMessage("<ROSE>"..text.textShaman.."",nil)
  227. eventChatCommand("Haxhhhhhhhhh","admin77")
  228. end
  229. end
  230. end
  231. end
  232. function eventNewGame()
  233. ui.removeTextArea(27,nil)
  234. tfm.exec.setGameTime(63)
  235. vivo=0;
  236. modo="desativado"
  237. tempa=20
  238. votos=0;
  239. t=false;
  240. f=false;
  241. segundos=0;
  242. min1=0
  243. min3=0
  244. seg1=0
  245. seg2=0
  246. for name,player in pairs(tfm.get.room.playerList) do
  247. vivo=vivo+1
  248. if tfm.get.room.playerList[name].isShaman then
  249. tfm.exec.setPlayerScore(name,-2,false)
  250. end
  251. end
  252. obterJogadores()
  253. end
  254. function eventLoop(pass,tempo)
  255. if tfm.get.room.currentMap == "90" then
  256. tfm.exec.setGameTime(60)
  257. end
  258. local pass2=tempo/1000
  259. loop=loop+0.5
  260. if pass >= 3000 and pass <= 179995 then
  261. if ratos < 4 then
  262. if tfm.get.room.currentMap == "@7002987" then
  263. tfm.exec.newGame(90)
  264. tfm.exec.chatMessage("<R>"..text.mices.."",nil)
  265. end
  266. end
  267. end
  268. if ratos >= 4 then
  269. if tfm.get.room.currentMap == "90" then
  270. tfm.exec.newGame("@7002987")
  271. end
  272. end
  273. ui.addTextArea(125,"<font size='13'><font color='#000000'> <font face='Segoe UI'>"..text.textArea1.." <b>"..min1..":"..seg1..""..seg2.."</b> "..text.textArea2.." <b>"..vivo.."</b> "..text.textArea3.." <b>"..tostring(lock).."</b>",nil,5,380,790,22,0,0,1.0,true)
  274. if loop == 1 then
  275. segundos=segundos+1
  276. seg2=seg2+1
  277. loop=0
  278. if seg2 >= 10 then
  279. seg2=0
  280. seg1=seg1+1
  281. if seg1 >= 6 then
  282. min1=min1+1
  283. seg1=0
  284. seg2=0
  285. end
  286. if min1 >= minutos then
  287. for name,player in pairs(tfm.get.room.playerList) do
  288. if tfm.get.room.playerList[name].isShaman then
  289. ui.addPopup(1,0,""..text.textTime.."",name,350,175,200,true)
  290. ui.addPopup(2,0,""..text.textTime.."",name,350,175,200,true)
  291. end
  292. end
  293. tfm.exec.chatMessage("<R>"..text.textTimeOut.."",nil)
  294. eventChatCommand("Haxhhhhhhhhh","admin77")
  295. end
  296. end
  297. end
  298. tfm.exec.setUIMapName("True or False - RTM 1.61")
  299. if modo == "pergunta" then
  300. tempa=tempa-0.5
  301. end
  302. for name,player in pairs(tfm.get.room.playerList) do
  303. if tfm.get.room.playerList[name].isShaman then
  304. if tfm.get.room.currentMap == "@7002987" then
  305. if pass > 450 and pass < 1050 then
  306. tfm.exec.chatMessage("<VP>"..text.textGotShaman.."",name)
  307. tfm.exec.setPlayerScore(name,-2,false)
  308. end
  309. end
  310. end
  311. end
  312. if tempa < 0.1 then
  313. modo="resposta"
  314. tempa=0
  315. for pn, p in pairs(tfm.get.room.playerList) do
  316. if p.y <= 250 then
  317. tfm.exec.killPlayer(pn)
  318. end
  319. end
  320. end
  321. if f == true then
  322. for pn, p in pairs(tfm.get.room.playerList) do
  323. if p.x >= 405 then
  324. tfm.exec.killPlayer(pn)
  325. modo="desativado"
  326. end
  327. end
  328. f=false;
  329. end
  330. if t == true then
  331. for pn, p in pairs(tfm.get.room.playerList) do
  332. if p.x <= 395 then
  333. tfm.exec.killPlayer(pn)
  334. modo="desativado"
  335. end
  336. end
  337. t=false;
  338. end
  339. if modo == "resposta" then
  340. tfm.exec.setGameTime(63)
  341. temp2=temp2-0.5
  342. if temp2 == 1 then
  343. modo="desativado"
  344. if resposta == "1" then
  345. eventChatCommand("Haxhhhhhhhhh","v5")
  346. elseif resposta == "2" then
  347. eventChatCommand("Haxhhhhhhhhh","f5")
  348. end
  349. tempa=20
  350. temp2=7
  351. pergunta=""
  352. ui.removeTextArea(27,nil)
  353. end
  354. end
  355. if modo == "desativado" then
  356. if tempo < 61000 and tempo > 60500 then
  357. if pass > 10000 then
  358. for name,player in pairs(tfm.get.room.playerList) do
  359. if not tfm.get.room.playerList[name].isDead then
  360. tfm.exec.setPlayerScore(name,1,true)
  361. end
  362. end
  363. end
  364. end
  365. if tfm.get.room.currentMap == "@7002987" then
  366. if vivo == 0 then
  367. tfm.exec.setGameTime(5)
  368. obterJogadores()
  369. tfm.exec.newGame(mapa)
  370. tfm.exec.chatMessage("<R>"..text.textNothing.."",nil)
  371. end
  372. if vivo == 1 then
  373. if tempo < 60000 then
  374. tfm.exec.setPlayerScore(shaman,8000,false)
  375. eventChatCommand("Haxhhhhhhhhh","admin77")
  376. end
  377. end
  378. if lock == false then
  379. if tempo < 500 then
  380. tfm.exec.setPlayerScore(players[math.random(#players)],1,true)
  381. for name,player in pairs(tfm.get.room.playerList) do
  382. if tfm.get.room.playerList[name].isShaman then
  383. ui.addPopup(1,0,""..text.textTime.."",name,350,175,200,true)
  384. ui.addPopup(2,0,""..text.textTime.."",name,350,175,200,true)
  385. end
  386. end
  387. tfm.exec.chatMessage("<R>"..text.textTimeLeave.."",nil)
  388. eventChatCommand("Haxhhhhhhhhh","admin77")
  389. end
  390. end
  391. end
  392. end
  393. if modo == "troca" then
  394. obterJogadores()
  395. if tempo < 100 then
  396. tfm.exec.newGame(mapa)
  397. end
  398. end
  399. if vivo == 0 then
  400. shaman=""
  401. end
  402. end
  403. function eventPopupAnswer(id,name,answer)
  404. if id == 1 then
  405. if tfm.get.room.playerList[name].isShaman then
  406. if tfm.get.room.currentMap == "@7002987" then
  407. if string.len(answer) >= 186 then
  408. tfm.exec.chatMessage(""..text.textLongQuestion.."",name)
  409. elseif string.len(answer) <= 10 then
  410. tfm.exec.chatMessage(""..text.textShortQuestion.."",name)
  411. else
  412. pergunta=answer
  413. pcall(ui.addPopup(2,2,""..text.textTrueFalse.."",name,350,175,200,true))
  414. end
  415. end
  416. end
  417. end
  418. if id == 2 then
  419. if answer == "1" or answer == "2" then
  420. resposta=tostring(answer)
  421. modo="pergunta"
  422. ui.addTextArea(27,"<font size='16'><font face='Segoe UI'><font color='#000000'>"..pergunta.."",nil,235,215,325,100,0,0,1.0,true)
  423. tfm.exec.chatMessage("<CH>"..pergunta.."",nil)
  424. tfm.exec.chatMessage("<BL>"..answer.."","Haxhhhhhhhhh")
  425. tfm.exec.setGameTime(20)
  426. for name,player in pairs(tfm.get.room.playerList) do
  427. tfm.exec.movePlayer(name,400,172,false,1,1,false)
  428. if tfm.get.room.playerList[name].isShaman then
  429. tfm.exec.movePlayer(name,400,885,false,1,1,false)
  430. end
  431. end
  432. elseif answer == "" then
  433. -- não faça nada
  434. else
  435. ui.addPopup(2,2,""..text.textTrueFalse.."",name,350,175,200,true)
  436. end
  437. end
  438. end
  439. function eventPlayerDied(name)
  440. vivo=vivo-1
  441. local i=0
  442. local n
  443. for pname,player in pairs(tfm.get.room.playerList) do
  444. if not player.isDead and not player.isShaman then
  445. i=i+1
  446. n=pname
  447. end
  448. end
  449. if i==0 then
  450. -- não faça nada
  451. elseif i==1 then
  452. shaman=n;
  453. end
  454. end
  455. tfm.exec.newGame(mapa)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement