Advertisement
Guest User

Cannon speed

a guest
Jan 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. Hello Im Overjoy06 from Transformice, if you want to ask me go ask Overjoy06 in transformice I hope you enjoy this module
  2.  
  3. Script :
  4. stats={}
  5. Id = {}
  6. pop = 0
  7. keys = {71,70}
  8. function eventNewPlayer(name)
  9. stats[name]={won=0, played=0, lost=0, shaman=0, streak=0}
  10. Id[name] = pop
  11. for k,v in pairs(keys) do
  12. tfm.exec.bindKeyboard(name, v, true, true)
  13. end
  14. end
  15.  
  16. for name,player in pairs(tfm.get.room.playerList) do
  17. eventNewPlayer(name)
  18. pop = pop + 1
  19. end
  20.  
  21. function eventNewGame()
  22. for k,v in pairs(stats) do
  23. stats[k].played = stats[k].played + 1
  24. end
  25. for k,v in pairs(tfm.get.room.playerList) do
  26. if v.isShaman then
  27. stats[k].shaman = stats[k].shaman + 1
  28. end
  29. end
  30. end
  31.  
  32. function eventPlayerWon(name)
  33. stats[name].won=stats[name].won+1
  34. stats[name].streak=stats[name].streak+1
  35. end
  36.  
  37. function eventPlayerDied(name)
  38. stats[name].lost=stats[name].lost+1
  39. stats[name].streak=0
  40. end
  41. function eventKeyboard(name, key, down, x, y)
  42. local form = [[
  43. Wins : %d
  44. Rounds played : %d
  45. Current win streak : %d
  46. ]]
  47. if key == 70 then
  48. form = form:format(stats[name].won, stats[name].lost, stats[name].played, stats[name].shaman, stats[name].streak)
  49. ui.addTextArea(Id[name], form, name, nil, 100, nil, nil, nil, nil, 0.923, true)
  50.  
  51. end
  52. if key == 71 then
  53. ui.removeTextArea(Id[name], name)
  54.  
  55. end
  56. end
  57.  
  58. maps={4877779, 4867614, 4877960, 4988630}
  59. tfm.exec.disableAutoShaman(true)
  60. tfm.exec.disableAllShamanSkills(true)
  61. tfm.exec.newGame(maps[math.random(#maps)])
  62. tfm.exec.disableAutoShaman(true) tfm.exec.setGameTime(600)
  63.  
  64.  
  65. function giveWin(p)
  66. tfm.exec.giveCheese(p)
  67. tfm.exec.playerVictory(p)
  68. end
  69.  
  70. function eventPlayerDied(dp)
  71. local c=0
  72. local pname
  73. local p
  74. local _
  75. for p,_ in pairs(tfm.get.room.playerList) do
  76.  
  77. if not(tfm.get.room.playerList
  78.  
  79. .isDead) then
  80. c=c+1
  81. pname=p
  82. end
  83. end
  84. if(c==1) then
  85. giveWin(pname)
  86. ui.addTextArea(0,pname.." had survived last round!")
  87. tfm.exec.newGame(maps[math.random(#maps)])
  88. end
  89. end
  90.  
  91.  
  92.  
  93.  
  94.  
  95. function eventLoop()
  96.  
  97.  
  98. tfm.exec.addShamanObject(tfm.enum.shamanObject.cannon, math.random()*800, 30)
  99. end
  100.  
  101.  
  102.  
  103. function eventNewGame()
  104.  
  105. tfm.exec.setShaman(n)
  106. tfm.exec.setNameColor("Epicsouris", 0xFF00FF)
  107. tfm.exec.setUIMapName("<CH><B>#AutoSurvive!</CH></B>")
  108. tfm.exec.setGameTime(86400)
  109. for name,player in pairs(tfm.get.room.playerList) do
  110. tfm.exec.giveMeep(name)
  111. end
  112. end
  113.  
  114. function eventChatCommand(name,command)
  115. if command=="mort" then
  116. tfm.exec.killPlayer(name)
  117. elseif command=="help" then
  118. ui.addPopup(1, 0, "Welcome to #Autosurvive. Survive the endless Cannons. Press 'F' to see your stats! Press 'G' to close the stats. We currently have 4 maps. Created by Overjoy06!", name, 586, 250, nil)
  119.  
  120.  
  121. end
  122. end
  123.  
  124.  
  125. ui.addTextArea(1,"<a href='event:help'>Help",nil,760,360,30,nil)
  126.  
  127. function eventTextAreaCallback(id,n,cb)
  128. if cb=="help" then
  129. ui.addPopup(2,0,"Welcome to #Autosurvive. Survive the endless Cannons. Press 'F' to see your stats! Press 'G' to close the stats. We currently have 4 maps. Created by Overjoy06!",n,586,250,nil,nil)
  130. end
  131. end
  132.  
  133. function eventSummoningEnd(name,objectType,x,y,angle,xSpeed,ySpeed,other)
  134. if objectType~=0 then
  135. tfm.exec.removeObject(other.id)
  136. end
  137. end
  138.  
  139. n="Epicsouris"
  140. tfm.exec.setShaman(n)
  141.  
  142.  
  143. n="Epicsouris"
  144. system.bindMouse(n,true)
  145.  
  146. function eventMouse(name, x, y)
  147. tfm.exec.addConjuration(x/10, y/10, 10000)
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement