Woterek

Dress-a-mouse!

Jan 19th, 2014
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.05 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAfkDeath(true)
  3. tfm.exec.disableAutoShaman(true)
  4. ch = {}
  5. players = {}
  6. time = 0
  7. time2 = 0
  8. time3 = 0
  9. map='<C><P /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="e0e3e6" X="400" c="4" Y="200" T="12" H="400" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="a5a8aa" X="400" Y="370" T="12" H="80" /><S P="0,0,0.3,0.2,-50,0,0,0" L="350" o="a5a8aa" X="579" Y="274" T="12" H="111" /><S P="0,0,0.3,0.2,0,0,0,0" L="160" o="a5a8aa" X="729" Y="255" T="12" H="300" /><S P="1,-1,0.3,0.2,0,0,0,0" L="104" o="a5a8aa" X="625" Y="300" T="12" H="112" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" o="a5a8aa" X="100" c="3" Y="250" T="12" H="10" /><S H="10" L="100" o="a5a8aa" X="250" c="3" Y="250" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" o="a5a8aa" H="10" c="3" Y="250" T="12" X="400" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="e0e3e6" X="680" Y="70" T="12" H="60" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="e0e3e6" X="790" Y="70" T="12" H="60" /><S P="0,0,0.3,0.2,0,0,0,0" L="50" o="e0e3e6" X="175" Y="130" T="12" H="200" /><S L="50" o="e0e3e6" X="325" H="200" Y="130" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="30" o="e0e3e6" H="240" Y="130" T="12" X="465" /><S X="25" L="50" o="e0e3e6" H="300" c="1" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S H="10" L="100" o="a5a8aa" X="100" c="3" Y="130" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="100" o="a5a8aa" H="10" c="3" Y="130" T="12" X="250" /><S X="400" L="100" o="a5a8aa" H="10" c="3" Y="130" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="e0e3e6" X="400" c="3" Y="15" T="12" H="30" /><S P="1,1,0.3,0.2,0,1,0,0" L="100" o="b874bc" X="250" c="4" N="" Y="190" T="12" H="110" /><S H="110" L="100" o="b874bc" X="400" c="2" N="" Y="190" T="12" P="1,1,0.3,0.2,0,1,0,0" /><S P="1,1,0.3,0.2,0,1,0,0" L="100" o="b874bc" X="100" c="2" N="" Y="190" T="12" H="110" /><S H="110" L="100" o="b874bc" X="100" c="4" N="" Y="70" T="12" P="1,1,0.3,0.2,0,1,0,0" /><S P="1,1,0.3,0.2,0,1,0,0" L="100" o="b874bc" X="250" c="4" N="" Y="70" T="12" H="110" /><S H="110" L="100" o="b874bc" X="400" c="4" N="" Y="70" T="12" P="1,1,0.3,0.2,0,1,0,0" /><S L="10" H="10" X="0" Y="-100" T="12" P="1,0,0.3,0.2,0,0,1000,0" /><S L="10" H="10" X="30" Y="-100" T="12" P="1,0,0.3,0.2,0,0,1000,0" /><S L="10" H="10" X="-5" Y="-90" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="313" X="80" /></D><O /><L><JP M2="4" AXIS="0,1" MV="0,0" M1="24" /><JP M2="4" AXIS="0,1" MV="0,0" M1="25" /><JP M2="25" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="18" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="19" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="20" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="21" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="22" AXIS="0,1" MV="0,0" M1="24" LIM1="" /><JP M2="23" AXIS="0,1" MV="0,0" M1="24" LIM1="" /></L></Z></C>'
  10.  
  11. function eventNewPlayer(name)
  12.  ch[name] = 0
  13. end
  14.  
  15. for name,player in pairs(tfm.get.room.playerList) do
  16.  eventNewPlayer(name)
  17.  table.insert(players,name)
  18. end
  19.  
  20. function start()
  21.  ui.removeTextArea(1, nil)
  22.  tfm.exec.newGame(map)
  23.  ui.addTextArea(0, '<B><B><a href="event:1">1</a> \t\t\t\t\t\t<a href="event:2">2<a/> \t\t\t\t\t\t<a href="event:3">3<a/> \n\n\n<a href="event:4">4<a/> \t\t\t\t\t\t<a href="event:5">5<a/> \t\t\t\t\t\t<a href="event:6">6<a/>' , nil, 100, 100, 0, 0, nil, nil, 0)
  24.  if s==nil then
  25.   s = players[math.random(#players)]
  26.  end
  27.  tfm.exec.movePlayer(s, 700, 70, false, 0, 1, false)
  28.  time2 = os.time()
  29.  stt = 0
  30.  sttt = 0
  31.  ch1 = 0
  32.  ch2 = 0
  33.  ch3 = 0
  34.  ch4 = 0
  35.  ch5 = 0
  36.  ch6 = 0
  37.  sd = 1
  38.  chh = 0
  39.  rd = 0
  40.  tfm.exec.setGameTime(10, true)
  41.  for name in pairs(tfm.get.room.playerList) do
  42.   tfm.exec.setNameColor(name, 0xFFFFFF)
  43.   tfm.exec.setNameColor(s, 0xFF0000)
  44.   ch[name] = 0
  45.   if name ~= s then
  46.    ui.addTextArea(3, "<R><B>Click on the number to get in the dressing room!", nil, 475, 360, 0, 0, nil, nil, 0)
  47.   end
  48.  end
  49. end
  50. start()
  51.  
  52. function eventPopupAnswer(id, name, anw)
  53.  if id == 1 then
  54.   ui.removeTextArea(3, nil)
  55.   ui.addTextArea(0, "<R><B>The theme is \""..anw.."\"\nYou have got 2 min to dress up your's mice!", nil, 500, 300, 0, 0, nil, nil, 0)
  56.   for name in pairs(tfm.get.room.playerList) do
  57.    if ch[name] == 1 then
  58.     ui.addTextArea(2, '<a href="event:rd"><font size="25">• Done</font><a>', name, 500, 350, 0, 0, nil, nil, 0)
  59.    end
  60.   end
  61.   tfm.exec.setGameTime(120, true)
  62.   time = os.time()
  63.   st = 1
  64.   anw2 = anw
  65.  end
  66. end
  67.  
  68. function cont()
  69.  tfm.exec.newGame(map)
  70.  tfm.exec.movePlayer(ch1, 100, 125, false, 0, 1, false)
  71.  tfm.exec.movePlayer(ch2, 250, 125, false, 0, 1, false)
  72.  tfm.exec.movePlayer(ch3, 400, 125, false, 0, 1, false)
  73.  tfm.exec.movePlayer(ch4, 100, 180, false, 0, 1, false)
  74.  tfm.exec.movePlayer(ch5, 250, 180, false, 0, 1, false)
  75.  tfm.exec.movePlayer(ch6, 400, 180, false, 0, 1, false)
  76.  tfm.exec.addShamanObject(28, 15, -80)
  77.  st = 0
  78.  ui.addTextArea(0, "<R><B>The theme was \""..anw2.."\"", nil, 500, 300, 0, 0, nil, nil, 0)
  79.  ui.removeTextArea(2, nil)
  80.  ui.addTextArea(1, "<R><B>"..s.." is chosing...", nil, 500, 330, 0, 0, nil, nil, 0)
  81.  ui.addTextArea(1, "<R><B>Chose a mice by typing !Nick", s, 500, 330, 0, 0, nil, nil, 0)
  82. end
  83.  
  84. function eventLoop()
  85.  if time < os.time()-1000*120 and st == 1 then
  86.   cont()
  87.  end
  88.  if time2 <os.time()-1000*10 and stt == 0 and chh >= 1 then
  89.   ui.addPopup(1,2,'Enter theme!',s,300,150,200)
  90.   stt = 1
  91.  end
  92.  if time3 <os.time()-1000*10 and sttt == 1 then
  93.   start()
  94.  end
  95.  if rd == chh and rd ~=0 then
  96.   cont()
  97.   rd = 0
  98.  end
  99. end
  100.  
  101. function eventTextAreaCallback(id, name, cb)
  102.  if s~=name then
  103.   if cb == '1' and ch1 == 0 and ch[name] == 0 then
  104.    ch1 = name
  105.    ch[name] = 1
  106.    chh = chh+1
  107.    tfm.exec.movePlayer(name, 100, 125, false, 0, 1, false)
  108.   elseif cb == '2' and ch2 == 0 and ch[name] == 0 then
  109.    ch2 = name
  110.    ch[name] = 1
  111.    chh = chh+1
  112.    tfm.exec.movePlayer(name, 250, 125, false, 0, 1, false)
  113.   elseif cb == '3' and ch3 == 0 and ch[name] == 0  then
  114.    ch3 = name
  115.    ch[name] = 1
  116.    chh = chh+1
  117.    tfm.exec.movePlayer(name, 400, 125, false, 0, 1, false)
  118.   elseif cb == '4' and ch4 == 0 and ch[name] == 0  then
  119.    ch4 = name
  120.    ch[name] = 1
  121.    chh = chh+1
  122.    tfm.exec.movePlayer(name, 100, 180, false, 0, 1, false)
  123.   elseif cb == '5' and ch5 == 0 and ch[name] == 0  then
  124.    ch5 = name
  125.    ch[name] = 1
  126.    chh = chh+1
  127.    tfm.exec.movePlayer(name, 250, 180, false, 0, 1, false)
  128.   elseif cb == '6' and ch6 == 0 and ch[name] == 0  then
  129.    ch6 = name
  130.    ch[name] = 1
  131.    chh = chh+1
  132.    tfm.exec.movePlayer(name, 400, 180, false, 0, 1, false)
  133.   end
  134.  end
  135.  if cb == "rd" then
  136.   rd = rd+1
  137.   ui.removeTextArea(2, name)
  138.  end
  139. end
  140.  
  141. function eventChatCommand(name,komd)
  142.  if s==name then
  143.   for v,nick in pairs(players) do
  144.    if komd==nick and sd == 1 then
  145.     if komd == ch1 or komd == ch2 or komd == ch3 or komd == ch4 or komd == ch5 or komd == ch6 then
  146.      tfm.exec.setPlayerScore(komd,10,true)
  147.      S=tfm.get.room.playerList[komd]
  148.      for i=1,20 do
  149.       tfm.exec.displayParticle(29,S.x,S.y-50,math.random(-30,30)/10,math.random(-30,30)/10,0,0)
  150.      end
  151.      time3 = os.time()
  152.      sttt = 1
  153.      sd = 0
  154.      s=komd
  155.     end
  156.    end
  157.   end
  158.  end
  159. end
Advertisement
Add Comment
Please, Sign In to add comment