DougCp

Evento de Abrazos

Mar 18th, 2016
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.78 KB | None | 0 0
  1. tfm.exec.disableAfkDeath(true)
  2. tfm.exec.disableAutoShaman(true)
  3.  
  4. tfm.exec.newGame('<C><P L="5400" D="x_transformice/x_evt/x_evt_04/cwlb1bml/fond.jpg" DS="m;5360,350,40,350" mc="" Ca="" /><Z><S><S Y="380" L="120" o="324650" H="40" c="1" N="" i="-30,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage11.png" T="12" X="60" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,50,0,0,0" L="50" o="0" H="27" c="3" N="" Y="388" T="12" m="" X="125" /><S P="1,0,0.3,0.2,0,0,0,0" L="150" o="324650" X="80" c="4" Y="200" T="13" m="" H="10" /><S P="1,0,0.3,1.2,0,1,9999,9999" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" L="150" o="324650" H="40" c="1" N="" Y="380" T="12" X="215" /><S X="80" L="10" o="0" H="10" c="4" Y="340" T="12" m="" P="1,0,0.3,0.2,0,1,0,0" /><S Y="150" L="150" o="324650" H="40" c="1" N="" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" T="12" X="360" P="1,0,0.3,0.2,0,1,9999,9999" /><S P="1,0,0.3,0.2,0,1,0,0" L="10" o="0" H="10" c="4" Y="200" T="12" m="" X="-65" /><S P="0,0,0.3,0.2,0,0,0,0" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" L="150" o="324650" H="40" c="1" N="" Y="380" T="12" X="830" /><S P="1,0,0.3,0.2,0,0,0,0" L="400" o="324650" X="1120" c="4" Y="700" T="13" m="" H="10" /><S Y="380" L="150" o="324650" H="40" c="1" N="" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" T="12" X="1370" P="0,0,0.3,0.2,0,0,0,0" /><S Y="315" L="100" o="324650" X="1120" c="3" N="" i="-250,0,x_transformice/x_evt/x_evt_04/cwlb1bml/arc en ciel petit.png" T="12" H="30" P="1,0,0.3,0.2,0,0,0,0" /><S X="1215" L="100" o="324650" H="30" c="3" Y="329" T="12" m="" P="1,0,0.3,0.2,15,0,0,0" /><S P="1,0,0.3,0.2,30,0,0,0" L="100" o="324650" H="30" c="3" Y="365" T="12" m="" X="1302" /><S P="1,0,0.3,0.2,-15,0,0,0" L="100" o="0" H="30" c="3" Y="327" T="12" m="" X="1027" /><S X="939" L="100" o="324650" H="30" c="3" Y="364" T="12" m="" P="1,0,0.3,0.2,-30,0,0,0" /><S P="1,0,0.3,0.2,-40,0,0,0" L="50" o="324650" H="30" c="3" Y="400" T="12" m="" X="880" /><S X="1358" L="50" o="324650" H="30" c="3" Y="402" T="12" m="" P="1,0,0.3,0.2,40,0,0,0" /><S Y="380" L="150" o="324650" H="40" c="1" N="" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" T="12" X="1530" P="1,0,50,0.2,0,1,0,0" /><S P="1,0,0.3,0.2,0,0,0,0" L="300" o="324650" X="1800" c="4" Y="-300" T="13" H="10" /><S X="1505" L="10" o="0" H="10" c="4" Y="-300" T="12" m="" P="1,0,0.3,0.2,0,1,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="2500" o="324650" X="2734" c="2" Y="405" T="12" H="10" /><S Y="200" L="100" o="324650" H="40" c="1" N="" i="-390,0,x_transformice/x_evt/x_evt_04/cwlb1bml/arc en ciel grand.png" T="12" X="2700" P="0,0,5,0.2,0,0,0,0" /><S Y="380" L="150" o="324650" H="40" c="1" N="" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" T="12" X="3100" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" L="150" o="324650" H="40" c="1" N="" Y="380" T="12" X="2300" /><S L="100" o="324650" H="40" X="2605" Y="208" T="12" m="" P="0,0,5,0.2,-10,0,0,0" /><S P="0,0,5,0.2,-20,0,0,0" L="100" o="324650" X="2514" Y="233" T="12" m="" H="40" /><S L="100" o="324650" X="2428" H="40" Y="273" T="12" m="" P="0,0,5,0.2,-30,0,0,0" /><S P="0,0,5,0.2,-40,0,0,0" L="100" o="324650" H="40" Y="327" T="12" m="" X="2351" /><S L="100" o="324650" H="40" X="2287" Y="391" T="12" m="" P="0,0,5,0.2,-50,0,0,0" /><S P="0,0,5,0.2,10,0,0,0" L="100" o="324650" X="2796" Y="208" T="12" m="" H="40" /><S L="100" o="324650" X="2889" H="40" Y="233" T="12" m="" P="0,0,5,0.2,20,0,0,0" /><S P="0,0,5,0.2,30,0,0,0" L="100" o="324650" H="40" Y="273" T="12" m="" X="2976" /><S L="100" o="324650" H="40" X="3054" Y="328" T="12" m="" P="0,0,5,0.2,40,0,0,0" /><S P="0,0,5,0.2,50,0,0,0" L="100" o="324650" X="3119" Y="393" T="12" m="" H="40" /><S Y="380" L="120" o="324650" H="40" c="1" N="" i="-80,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage1.png" T="12" X="5340" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,-50,0,0,0" L="50" o="0" H="27" c="3" N="" Y="388" T="12" m="" X="5275" /><S P="1,0,0.3,1.2,0,1,9999,9999" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" L="150" o="324650" H="40" c="1" N="" Y="380" T="12" X="5185" /><S X="225" L="10" o="0" H="10" c="4" Y="203" T="12" m="" P="1,0,0.3,0.2,0,1,0,0" /><S Y="150" L="150" o="324650" H="40" c="1" N="" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" T="12" X="5040" P="1,0,0.3,0.2,0,1,9999,9999" /><S P="0,0,0.3,0.2,0,0,0,0" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" L="150" o="324650" H="40" c="3" N="" Y="380" T="12" X="4540" /><S P="1,0,0,0.2,0,0,0,0" L="400" o="324650" X="4280" c="2" Y="700" T="13" m="" H="10" /><S Y="380" L="150" o="324650" H="40" c="3" N="" i="-90,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage2.png" T="12" X="4050" P="0,0,0.3,0.2,0,0,0,0" /><S Y="315" L="100" o="324650" X="4280" c="3" N="" i="-250,0,x_transformice/x_evt/x_evt_04/cwlb1bml/arc en ciel petit.png" T="12" H="30" P="1,0,0.3,0.2,0,0,0,0" /><S X="4185" L="100" o="324650" H="30" c="3" Y="329" T="12" m="" P="1,0,0.3,0.2,-15,0,0,0" /><S P="1,0,0.3,0.2,-30,0,0,0" L="100" o="324650" H="30" c="3" Y="365" T="12" m="" X="4098" /><S P="1,0,0.3,0.2,15,0,0,0" L="100" o="0" H="30" c="3" Y="327" T="12" m="" X="4373" /><S X="4461" L="100" o="324650" H="30" c="3" Y="364" T="12" m="" P="1,0,0.3,0.2,30,0,0,0" /><S P="1,0,0.3,0.2,40,0,0,0" L="50" o="324650" H="30" c="3" Y="400" T="12" m="" X="4520" /><S X="4042" L="50" o="324650" H="30" c="3" Y="402" T="12" m="" P="1,0,0.3,0.2,-40,0,0,0" /><S Y="380" L="150" o="324650" H="40" c="1" N="" i="-10,-10,x_transformice/x_evt/x_evt_04/cwlb1bml/nuage_plateforme.png" T="12" X="3255" P="1,0,50,0.2,0,1,0,0" /><S X="2095" L="10" o="0" H="10" c="4" Y="-300" T="12" m="" P="1,0,0.3,0.2,0,1,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="1000" o="324650" X="3450" c="2" Y="405" T="12" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="1074" o="324650" X="4283" Y="1124" T="12" H="35" /><S P="0,0,0.3,0.2,0,0,0,0" L="129" o="324650" X="3805" Y="808" T="12" H="743" /><S P="0,0,0.3,0.2,0,0,0,0" L="147" o="324650" X="4761" Y="787" T="12" H="739" /><S L="13" o="324650" H="40" X="3985" Y="380" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DC Y="325" X="1420" /></D><O><O C="12" Y="200" X="80" P="0" /><O C="13" Y="700" P="0" X="1120" /><O C="12" Y="-300" X="1800" P="0" /></O><L><JP M1="3" M2="4" AXIS="1,0" /><JP M1="5" M2="6" AXIS="0,1" /><JR M1="2" M2="6" P1="-65,200" /><JR M1="2" M2="4" P1="80,340" /><JR M1="18" M2="19" P1="1505,-300" /><JP M1="19" M2="17" AXIS="0,1" /><JP M1="38" M2="37" AXIS="0,1" /><JP M1="4" M2="36" AXIS="1,0" /><JR M1="19" M2="50" P1="2095,-300" /><JP M1="50" M2="49" AXIS="0,1" /><JR M1="2" M2="37" P1="225,202" /><JR M1="42" M2="40" MV="Infinity,-0.2" /><JR M1="45" M2="40" MV="Infinity,-0.2" /><JR M1="46" M2="40" MV="Infinity,-0.2" /><JR M1="47" M2="40" MV="Infinity,-0.2" /><JR M1="43" M2="40" MV="Infinity,-0.2" /><JR M1="44" M2="40" MV="Infinity,-0.2" /><JR M1="48" M2="40" MV="Infinity,-0.2" /><JR M1="10" M2="8" MV="Infinity,0.05" /><JR M1="11" M2="8" MV="Infinity,0.05" /><JR M1="12" M2="8" MV="Infinity,0.05" /><JR M1="16" M2="8" MV="Infinity,0.05" /><JR M1="13" M2="8" MV="Infinity,0.05" /><JR M1="14" M2="8" MV="Infinity,0.05" /><JR M1="15" M2="8" MV="Infinity,0.05" /></L></Z></C>')
  5. tfm.exec.disableAutoNewGame(true)
  6.  
  7. tfm.exec.setUIMapName("Transformice<bl> - @2003")
  8. function eventNewPlayer(player)
  9. tfm.exec.respawnPlayer(player)
  10. end
  11.  
  12.  
  13. function eventPlayerDied(player)
  14. tfm.exec.respawnPlayer(player)
  15. if p[player].team=="red" then
  16. tfm.exec.setNameColor(player, 0xff0000)
  17. else
  18. tfm.exec.setNameColor(player, 0x0000ff)
  19. end
  20. end
  21.  
  22. function eventPlayerRespawn(name)
  23. if p[name].team=="red" then
  24. tfm.exec.movePlayer(name,40,350,false,0,0,false)
  25. else
  26. tfm.exec.movePlayer(name,5360,350,false,0,0,false)
  27. end
  28. end
  29.  
  30. function eventPlayerWon(player)
  31. tfm.exec.respawnPlayer(player)
  32. if p[player].team=="red" then
  33. tfm.exec.setNameColor(player, 0xff0000)
  34. else
  35. tfm.exec.setNameColor(player, 0x0000ff)
  36. end
  37. end
  38. p={}
  39.  
  40. i=1
  41.  
  42. function eventNewGame()
  43. colors = { 0xff0000, 0x0000ff }
  44. for name, player in pairs(tfm.get.room.playerList) do
  45. tfm.exec.setNameColor(name, colors[ i ])
  46. if (i == #colors) then
  47. i = 1
  48. p[name]={team="blue"}
  49. tfm.exec.movePlayer(name,5360,350,false,0,0,false)
  50. else
  51. i = i + 1
  52. p[name]={team="red"}
  53. tfm.exec.movePlayer(name,40,350,false,0,0,false)
  54. end
  55. end
  56. end
  57.  
  58. huggers = {}
  59.  
  60. for n,p in pairs(tfm.get.room.playerList) do eventNewPlayer(n) end
  61.  
  62. function eventEmotePlayed(playerName, emoteId)
  63. for i,n in ipairs(huggers) do if n == playerName then table.remove(huggers) end end
  64. if emoteId == 17 then
  65. table.insert(huggers, playerName)
  66. end
  67. if emoteId == 18 or emoteId == 19 then
  68. for i,n in ipairs(huggers) do
  69. local x1 = tfm.get.room.playerList[n].x
  70. local y1 = tfm.get.room.playerList[n].y
  71. local x2 = tfm.get.room.playerList[playerName].x
  72. local y2 = tfm.get.room.playerList[playerName].y
  73. if math.sqrt((x2 - x1)^2 + (y2 - y1)^2) <= 30 then
  74. if p[n].team=="red" and p[playerName].team=="blue" then
  75. tfm.exec.giveCheese(n)
  76. tfm.exec.giveCheese(playerName)
  77. tfm.exec.playerVictory(n)
  78. tfm.exec.playerVictory(playerName)
  79. table.remove(huggers, i)
  80. elseif p[n].team=="blue" and p[playerName].team=="red" then
  81. tfm.exec.giveCheese(n)
  82. tfm.exec.giveCheese(playerName)
  83. tfm.exec.playerVictory(n)
  84. tfm.exec.playerVictory(playerName)
  85. table.remove(huggers, i)
  86. end
  87. end
  88. end
  89. end
  90. end
  91.  
  92. function eventKeyboard(playerName, key)
  93. for i,n in ipairs(huggers) do
  94. if n == playerName then
  95. table.remove(huggers, i)
  96. end
  97. end
  98. end
  99.  
  100. function eventNewPlayer(name)
  101. for i,k in pairs({0,1,2,3}) do
  102. system.bindKeyboard(playerName, k, true, true)
  103. end
  104. tfm.exec.respawnPlayer(name)
  105. tfm.exec.setNameColor(name, colors[ i ])
  106. if (i == #colors) then
  107. i = 1
  108. p[name]={team="blue"}
  109. tfm.exec.movePlayer(name,5360,350,false,0,0,false)
  110. else
  111. i = i + 1
  112. p[name]={team="red"}
  113. tfm.exec.movePlayer(name,40,350,false,0,0,false)
  114. end
  115.  
  116. end
Add Comment
Please, Sign In to add comment