Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 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 <font color='#6C77C1'>- Magic 8 ball</font><font color='#60608f'> | </font> /info <font color='#60608f'> | </font> !help ")
- answers={"Бесспорно",
- "Предрешено",
- "Никаких сомнений",
- "Определённо да",
- "Можешь быть уверен в этом",
- "Мне кажется — «да»",
- "Вероятнее всего",
- "Хорошие перспективы",
- "Знаки говорят — «да»",
- "Да",
- "Пока не ясно, попробуй снова",
- "Спроси позже",
- "Лучше не рассказывать",
- "Сейчас нельзя предсказать",
- "Сконцентрируйся и спроси опять",
- "Даже не думай",
- "Мой ответ — «нет»",
- "По моим данным — «нет»",
- "Перспективы не очень хорошие",
- "Весьма сомнительно",
- }
- function eventPlayerDied(playerName)
- tfm.exec.respawnPlayer (playerName)
- end
- function eventNewGame()
- 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)
- end
- system.disableChatCommandDisplay("help", true)
- system.disableChatCommandDisplay("помощь", true)
- function eventChatCommand(playerName, msg)
- if string.lower(msg)=="встряхнуть" or string.lower(msg)=="вст" then
- 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)
- 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,"<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)
- 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,"<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)
- elseif string.lower(msg):match("или") then
- local choose=math.random(0,1)
- if choose==1 then
- 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)
- else
- 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)
- 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 <font color='#6C77C1'>- Magic 8 ball</font><font color='#606090'> | </font> /info")
- 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)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement