-- Magic 8 Ball -- ©Zigwin tfm.exec.disableAutoTimeLeft(true) tfm.exec.disableAutoNewGame(true) tfm.exec.disableAutoScore(true) tfm.exec.disableAfkDeath(true) tfm.exec.disableAutoShaman(true) tfm.exec.newGame (7229945) tfm.exec.setUIMapName("Zigwin - Magic 8 ball | /info | !help ") answers={"Бесспорно", "Предрешено", "Никаких сомнений", "Определённо да", "Можешь быть уверен в этом", "Мне кажется — «да»", "Вероятнее всего", "Хорошие перспективы", "Знаки говорят — «да»", "Да", "Пока не ясно, попробуй снова", "Спроси позже", "Лучше не рассказывать", "Сейчас нельзя предсказать", "Сконцентрируйся и спроси опять", "Даже не думай", "Мой ответ — «нет»", "По моим данным — «нет»", "Перспективы не очень хорошие", "Весьма сомнительно", } function eventPlayerDied(playerName) tfm.exec.respawnPlayer (playerName) end function eventNewGame() ui.addTextArea(1,"
Задай вопроси и напиши !Встряхнуть
",nil,365,170,70,70,0x555555,0x555555,0,true) end system.disableChatCommandDisplay("help", true) system.disableChatCommandDisplay("помощь", true) function eventChatCommand(playerName, msg) if string.lower(msg)=="встряхнуть" or string.lower(msg)=="вст" then ui.updateTextArea (1,""..playerName..", "..answers[math.random(1,#answers)].."
",nil) for i=1,10 do tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil) end end if string.lower(msg)=="help" or string.lower(msg)=="помощь" then ui.addPopup(0,0,"!вст или !встряхнуть - Шар показывает ответ на ваш вопрос\n'Кто' - Шар выбирает игрока из комнаты\n 'Или' - Шар выбирает между текстом до и после 'или'
",playerName,200,50,400) end end function eventChatMessage (playerName, msg) if string.lower(msg):match("кто") then local players={"я"} for k,v in pairs(tfm.get.room.playerList) do table.insert(players, k) end for i=1,10 do tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil) end local choose=players[math.random(1,#players)] if choose==playerName then choose="ты" end ui.updateTextArea (1,""..playerName..", Это "..choose.."
",nil) elseif string.lower(msg):match("или") then local choose=math.random(0,1) if choose==1 then ui.updateTextArea (1,""..playerName..", "..string.lower(msg):sub(string.find(msg, 'или')+7,#msg).."
",nil) else ui.updateTextArea (1,""..playerName..", "..string.lower(msg):sub(1, string.find(msg, 'или')-1).."
",nil) end for i=1,10 do tfm.exec.displayParticle(9, math.random(380,440), math.random(180,220),0,0,0,0, nil) end end end function eventNewPlayer(playerName) tfm.exec.respawnPlayer (playerName) tfm.exec.setUIMapName("Zigwin - Magic 8 ball | /info") ui.addTextArea(1,"Задай вопроси и напиши !Встряхнуть
",playerName,365,170,70,70,0x555555,0x555555,0,true) end