Advertisement
zigwin

zigwin:ball

Dec 18th, 2017
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.41 KB | None | 0 0
  1. --  Magic 8 Ball
  2. --    ©Zigwin
  3.  
  4. tfm.exec.disableAutoTimeLeft(true)
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAutoScore(true)
  7. tfm.exec.disableAfkDeath(true)
  8. tfm.exec.disableAutoShaman(true)
  9. tfm.exec.newGame (7229945)
  10. tfm.exec.setUIMapName("Zigwin <font color='#6C77C1'>- Magic 8 ball</font><font color='#60608f'>  |  </font> /info <font color='#60608f'>  |  </font> !help ")
  11.  
  12. answers={"Бесспорно",
  13. "Предрешено",
  14. "Никаких сомнений",
  15. "Определённо да",
  16. "Можешь быть уверен в этом",
  17. "Мне кажется — «да»",
  18. "Вероятнее всего",
  19. "Хорошие перспективы",
  20. "Знаки говорят — «да»",
  21. "Да",
  22. "Пока не ясно, попробуй снова",
  23. "Спроси позже",
  24. "Лучше не рассказывать",
  25. "Сейчас нельзя предсказать",
  26. "Сконцентрируйся и спроси опять",
  27. "Даже не думай",
  28. "Мой ответ — «нет»",
  29. "По моим данным — «нет»",
  30. "Перспективы не очень хорошие",
  31. "Весьма сомнительно",
  32. }
  33.  
  34. function eventPlayerDied(playerName)
  35.     tfm.exec.respawnPlayer (playerName)
  36. end
  37.  
  38. function eventNewGame()
  39.     ui.addTextArea(1,"<p align='center'><font size='10' color='#efefef' face='Verdana'>Задай вопроси и напиши <font color='#BABD2F'>!Встряхнуть</font></font></p>",nil,365,170,70,70,0x555555,0x555555,0,true)
  40. end
  41.  
  42. system.disableChatCommandDisplay("help", true)
  43. system.disableChatCommandDisplay("помощь", true)
  44.  
  45. function eventChatCommand(playerName, msg)
  46.     if string.lower(msg)=="встряхнуть" or string.lower(msg)=="вст" then
  47.         ui.updateTextArea (1,"<p align='center'><font size='10' color='#009D9D' face='Verdana'>"..playerName.."<font color='#efefef'>, "..answers[math.random(1,#answers)].."</font></p>",nil)
  48.         for i=1,10 do
  49.             tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil)
  50.         end
  51.     end
  52.     if string.lower(msg)=="help" or string.lower(msg)=="помощь" then
  53.         ui.addPopup(0,0,"<p align='center'><font size='10' color='#efefef' face='Verdana'><font size='10' color='#009D9D' face='Verdana'>!вст</font> или <font size='10' color='#009D9D' face='Verdana'>!встряхнуть</font> - Шар показывает ответ на ваш вопрос\n'<font size='10' color='#009D9D' face='Verdana'>Кто</font>' - Шар выбирает игрока из комнаты\n '<font size='10' color='#009D9D' face='Verdana'>Или</font>' - Шар выбирает между текстом до и после 'или'</font></p>",playerName,200,50,400)
  54.     end
  55. end
  56.  
  57. function eventChatMessage (playerName, msg)
  58.     if string.lower(msg):match("кто") then
  59.         local players={"я"}
  60.         for k,v in pairs(tfm.get.room.playerList) do table.insert(players, k) end
  61.  
  62.         for i=1,10 do
  63.             tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil)
  64.         end
  65.         local choose=players[math.random(1,#players)]
  66.         if choose==playerName then choose="ты" end
  67.         ui.updateTextArea (1,"<p align='center'><font size='10' color='#009D9D' face='Verdana'>"..playerName.."<font size='10' color='#efefef' face='Verdana'>, Это </font><font size='10' color='#009D9D' face='Verdana'>"..choose.."</font></p>",nil)
  68.     elseif string.lower(msg):match("или") then
  69.         local choose=math.random(0,1)
  70.         if choose==1 then
  71.             ui.updateTextArea (1,"<p align='center'><font size='10' color='#009D9D' face='Verdana'>"..playerName.."<font color='#efefef'>, "..string.lower(msg):sub(string.find(msg, 'или')+7,#msg).."</font></p>",nil)
  72.         else
  73.             ui.updateTextArea (1,"<p align='center'><font size='10' color='#009D9D' face='Verdana'>"..playerName.."<font color='#efefef'>, "..string.lower(msg):sub(1, string.find(msg, 'или')-1).."</font></p>",nil)
  74.         end
  75.         for i=1,10 do
  76.             tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil)
  77.         end
  78.     end
  79. end
  80.  
  81. function eventNewPlayer(playerName)
  82.     tfm.exec.respawnPlayer (playerName)
  83.     tfm.exec.setUIMapName("Zigwin <font color='#6C77C1'>- Magic 8 ball</font><font color='#606090'>  |  </font> /info")
  84.     ui.addTextArea(1,"<p align='center'><font size='10' color='#efefef' face='Verdana'>Задай вопроси и напиши <font color='#BABD2F'>!Встряхнуть</font></font></p>",playerName,365,170,70,70,0x555555,0x555555,0,true)
  85. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement